Articles → .NET → How To Detect Session Time Out In .Net

How To Detect Session Time Out In .Net









  1. Add the sessionstate tag in web.config file
  2. <sessionState cookieless="false" timeout="1"></sessionState>




  3. Add following code in global.asax in Session_Start event
  4. Dim request_session As String = Request.Headers("Cookie")
    If request_session IsNot Nothing AndAlso request_session.IndexOf("ASP.NET_SessionId") >= 0 Then
    ' Redirect the page where you can give information to the user
    End If







Posted By  -  Karan Gupta
 
Posted On  -  Thursday, March 31, 2011

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250