Page Re-Direct On Session Timeout

G

Guest

I am using Form Authentication with the new authentication controls in
ASP.NET 2.0. I would like to be able to check to see if the user's session
has timed out and redirect them to a page to allow them to re-login in.
I don't want the page to be the same as the login page, since I would like to
give them a message to let them know what happened. I have tried testing a
session variable to see if it is "Nothing". This technique worked for me in
Version 1.0 of .NET but I am having trouble getting it to work in 2.0. My
current situation is that my application re-directs to the original Login
screen despite my
testing the session variable.

Anyone out their have a good technique for letting a user know that their
session has timed out. (Or even better is about to time out)

Is there any sample code out their to do this (I have no money to buy
a control, I need freeware :) .

Also if Microsoft is listening, this would be a good control to add to the
next version of Visual Studio, since it seems that everyone would need to
do this.

Thanks in advance...Ed
 
M

Mike

Create a javascript timer in your page. The timer should show a popup
with your message and an ok button a minute before their session times
out. If they press ok, it can post to the server to renew their
session, and reset the timer in the parent page.

A google search on "javascript timer" or "javascript timer popup" will
give alot of examples, such as:
http://www.javascript-page.com/timer.html
or
http://javascript.internet.com/navigation/delayed-popup.html

Michael Lang
XQuiSoft LLC
http://www/xquisoft.com/
 
F

Flinky Wisty Pomm

Where are you testing the session variable?

If you're testing it on the page, then your code won't execute because
the session/authentication handling occur before the page ever
initialises.

I'm not 100% sure where the right place to test this would be, perhaps
in Application_AcquireRequestState?
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top