how use ASP.NET_SessionId cookies to check timeout for 2 different web applications
- by user553858
Hi All
I am developing 2 web applications based on "ASP.NET_SessionId" cookies to check session timeout and also to logout :
protected void Session_Start(object sender, EventArgs e)
{
if (Context.Session != null)
{
//check the IsNewSession value, this will tell us if the session has been reset
if (Session.IsNewSession)
{
string cookie = Request.Headers["Cookie"];
// Code that runs when a new session is started
if ((null != cookie) && (cookie.IndexOf("ASP.NET_SessionId") >= 0))
{
if (Request.QueryString["timeout"] == null || !Request.QueryString["timeout"].ToString().Equals("yes"))
Session.Abandon();
Session.Clear();
Response.Redirect("Login.aspx?timeout=yes");
}
}
}
}
This works fine for my first application. When implementing the same logic for the 2nd application when I press logout in one application, the second application is redirected to the login page.
How can I fix this?
Best regards