Session Timeout

D

Dave Harrington

Hello all -

I am developing a web application which uses forms authentication. I use
session data remember important variables (like login name, email address,
etc) throughout the site. I have a session timeout set to 20 minutes.

What I want to happen is I want all of the Session data and the URL the user
is on to be remembered in something like a database. This is easy enough
using the Session_End function. What I also want to happen, is when their
session is timed out, I want them either to be redirected to a "Log back In"
page or have a page like this pop up (like a dialog box). When they log
back in, they will return to the exact place they were before their session
timed out.

Does anyone have a solution that's easy to implement ( or at least ideas) in
how to accomplish this?

Thanks in Advance!

Dave
 
P

Philip Q [MVP]

A possible way would be to store their UserID (or other identifier) with
their session information, then save that and their last location in a
database.
When they return, you can leave it to ASP.NET to redirect them to the login
page (since they will probably try to access a page that they no longer have
access to and will get a login page anyway).
Then when a user logs in, check the database to see if their UserID has a
location associated with it, delete the location and redirect them to it.
 

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

Top