Articles → .NET → How To Detect Session Time Out In .Net
How To Detect Session Time Out In .Net
- Add the sessionstate tag in web.config file
<sessionState cookieless="false" timeout="1"></sessionState>
- Add following code in global.asax in Session_Start event
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