Managing Session

G

Guest

I'm using ASP.NEt 2.0.
I use the session to save important information about the user current
session (for example the current project he is working on).
I use those variables in almost every web page in the application.
When a user session times out, I want to be able to make the user to relogin
and continue working with the application.
1. Is there easy way to catch an even just before the session times out? Or
to prelong a session (so I want lose all the variables stored there?)
2. What's the recommended way to deliver the user to the login page and than
bring him back to where he stopped using the application?
 
H

Hans Kesting

I'm using ASP.NEt 2.0.
I use the session to save important information about the user current
session (for example the current project he is working on).
I use those variables in almost every web page in the application.
When a user session times out, I want to be able to make the user to relogin
and continue working with the application.
1. Is there easy way to catch an even just before the session times out? Or
to prelong a session (so I want lose all the variables stored there?)
2. What's the recommended way to deliver the user to the login page and than
bring him back to where he stopped using the application?

You could set the session timeout to a longer period than the default
20 minutes. Note that this will keep sessions around longer for people
that "really left" the site, so your memory consumption goes up.

For people that are slowly filling in a long page and hit the session
timeout, maybe you could add an iframe that refreshes itself every 10
minutes or so. This should keep their session alive.
There is no server-side way to "extend a session" because you don't
know if that user is ever coming back.

If the user hits some page, but misses some session variables, then
either the session was lost or he got there by typing a url.
You could remember that url, have him log in and redirect "back".
BUT if he needs to have some session variables from "previous pages"
then that information is gone and you should redirect him maybe to the
first page of the set.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top