Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session time out 3

Status
Not open for further replies.

jby1

Programmer
Apr 29, 2003
403
GB
Hi

I am working on an ASP.NET application which uses Windows Integrated security.

When the session expires, I would like to display a message to the user explaining what has happened, and then redirect them to their start page.

Can anybody tell me how I may do this?

Regards
 
place this in your message page..

<meta http-equiv="refresh" content="4;URL=YourPage.aspx">

this will redirect them to another page

 
Thanks, now all I need to so is get them to the message page!
 
Or you can do it server-side using Response.Redirect once you know the session has timed out and pass it through to the login page as a querystring e.g.
Code:
Response.Redirect("Login.aspx?TimeOut=True")
Then, on your login page you just have to check for the existence of the querstring value and display a message on the page if it does.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You will have to know your session has expired. On one of my apps I use the user ID as a session and pass it from page to page. maybe not the best way but it's an intranet site so that's why. but if the User ID session cannot be passed over to the next page I redirect them to my SessionTimeOut.aspx Page. which then tells them they will now be redirected to the login page. very simple.

 
Alternatively, in version 2.0 of the framework there is the new Session.IsNewSession() method.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
And JohnYingling spots my deliberate mistake... oops [blush]


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
The IsNewSession property seems to be something I can use for this, thanks guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top