Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 13th, 2006, 06:48 AM
Registered User
Join Date: Dec 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Handle SessionTimeout

 I want to redirect the control to Login page whenever the session expires with a message that session has expired. How to do it?

Thank you

Old January 13th, 2006, 04:43 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Are you using forms authentication? I have found that there's a slight problem when you rely on a session that has value populated from a login. The forms authentication cookie is maintained as long as the browser is open even if the user's session dies. So I put in a check to look at a certain session value. If that value is missing it performs a forms authentication logout to force a return to the login page.

Old January 16th, 2006, 01:45 PM
Friend of Wrox
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts

This might help too.

This is code that I have on the login page where I set a Session value if the login is successful and redirect to the default page.

        If Len(Session("EmpID")) = 0 Then
        End If

I check for that session value on each page in the application so that if you don't have that session value you get redirected back to the login page.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help getting desktop handle Regie General .NET 0 January 23rd, 2006 04:42 PM
How to handle...? chawnu Pro PHP 1 December 8th, 2005 05:14 AM
Getting handle of the file in use baburman .NET Framework 2.0 0 October 16th, 2005 10:56 PM
How to handle this error Maxood Classic ASP Databases 2 June 27th, 2004 02:57 PM
Getting value contained by HANDLE panja_swarup C++ Programming 1 December 16th, 2003 10:31 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.