Hi,
Below covers the gotcha with SessionStart and SessionEnd.
Session Start & Sesssion_End Event
Ø Start event fires only for the one time when the very first page is requested in the browser. i.e it does not fire for the any number of next or same page request.
Ø Session End event fires when Session is timeouted out or LogOut fired using below code.
Ø Once End fires, Start event refires when again a very first page is requested in the browser.
System.Web.Security.FormsAuthentication.SignOut();
Session.Abandon();
Gotcha –
Ø Once the Start event is fired on the very first page request, if there is some link in that page, which opens another page in a new browser window, then it does not lead to fire Session Start.
Ø Now on this new page which is a new window - If you fire logout, then the Session End fires. This end event ends the session for the parent window (which opened the seperate window) as well.
Ø Once the Start event is fired on the very first page request. Now if you copy the url and paste in another browser window – This leads to to fire another Session Start.
Ø Now on this new page which is a new window - If you fire logout, then the Session End fires. But this end event ends the session of only the new window and not of the parent window (which opened the seperate window) as well.
In an all the
But
Thanks & Regards,
Arun Manglick || Senior Tech Lead
No comments:
Post a Comment