Session_Start is firing upon every request in an asp.net Application after calling Session.Abandon() and FormsAuthentication.SignOu
I have attached sample code that shows the behavior I am seeing. Follow the steps below with the sample code.
1: Set breakpoints on Session_Start and Session_End method in global.asax
2: Login into the website
3: Use links provided to navigate between two pages(Home and Page2).
4: Click Logout but don't close the browser
5: Repeat step 2-3
After second login you will see Session_Start and Session_End is called upon every page request i.e. when you navigate between home and page2. The most important thing is Session_End is called immediately after Session_Start before the page is shown.
Points to note:
1: I am doing manual logout in the logout.aspx.cs by calling FormsAuthentication.Signou
t() and also calling Session.Abandon.
2: If I comment out the Session.Abandon() in the logout.aspx.cs page, it works fine and Session_Start doesn't fire upon every request.
3: I have tried IE and FF.
There is something really small concept I am missing about Session here. Anyone has any ideas?
PS: I wasn't able to upload .asax file but here is the content of global.asax.
<%@ Application Language="C#" %>
void Session_Start(object sender, EventArgs e)
void Session_End(object sender, EventArgs e)