rito1
asked on
Abandon Session on Browser Close or Browsing Away
HI All,
When a user logs into my website is creates the Session variable UserID.
When the user logs out using the logout button, I call Session.Abandon() which in turn calls Session_End() within my Global.asax file. This function uses the UserID variable and performs a transaction against my database.
this works really well proving the user uses the damn logout button! But what I am finding is that users are either browsing away from the site or closing their browser down which isn't then performing that all important transaction against my database.
Does anyone have any magic code which can check for users browsing away or browser closing which in turn maintains the session variable whilst calling Session_End()?
Many thanks,
Rit
When a user logs into my website is creates the Session variable UserID.
When the user logs out using the logout button, I call Session.Abandon() which in turn calls Session_End() within my Global.asax file. This function uses the UserID variable and performs a transaction against my database.
this works really well proving the user uses the damn logout button! But what I am finding is that users are either browsing away from the site or closing their browser down which isn't then performing that all important transaction against my database.
Does anyone have any magic code which can check for users browsing away or browser closing which in turn maintains the session variable whilst calling Session_End()?
Many thanks,
Rit
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not sure what you mean that the session variable didn't seem to persist long enough.
Either way does the link I pasted answer your question?
Either way does the link I pasted answer your question?
ASKER
Thanks Both, - b_levitt, thanks for the link.
Rit
Rit
ASKER
B_levitt, I tried to rely on Session Timeout but I want to use the session variable which didn't seem to persist long enough for the global.asax Session_End event when a browser is closed.