Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <sessionState mode="InProc" timeout="1" />
- Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
- Response.Redirect("Login.aspx")
- End Sub
- Response is not available in this context.
- Protected Sub Page_Init(sender As Object, e As EventArgs)
- If Context.Session IsNot Nothing Then
- If Session.IsNewSession Then
- Dim newSessionIdCookie As HttpCookie = Request.Cookies("ASP.NET_SessionId")
- If newSessionIdCookie IsNot Nothing Then
- Dim newSessionIdCookieValue As String = newSessionIdCookie.Value
- If newSessionIdCookieValue <> String.Empty Then
- ' This means Session was timed Out and New Session was started
- Response.Redirect("Login.aspx")
- End If
- End If
- End If
- End If
- End Sub
- protected void Page_Init(object sender, EventArgs e)
- {
- if (Context.Session != null)
- {
- if (Session.IsNewSession)
- {
- HttpCookie newSessionIdCookie = Request.Cookies["ASP.NET_SessionId"];
- if (newSessionIdCookie != null)
- {
- string newSessionIdCookieValue = newSessionIdCookie.Value;
- if (newSessionIdCookieValue != string.Empty)
- {
- // This means Session was timed Out and New Session was started
- Response.Redirect("Login.aspx");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement