How to manage the Session_End Event at global.asax?

Last post 02-09-2007 9:32 PM by aweil. 2 replies.

Sort Posts:

  • How to manage the Session_End Event at global.asax?

    02-09-2007, 6:05 AM
    • Loading...
    • gabimadisa
    • Joined on 11-28-2006, 11:15 AM
    • Seville, Spain
    • Posts 31

    I need to subtract one unit to a variable when the session has finished. But if the user closes his Internet Explorer Browser, the Session_End method doesn't run. How can I to control that the user closes his browser windows?

    Thanks

  • Re: How to manage the Session_End Event at global.asax?

    02-09-2007, 9:02 AM
    • Loading...
    • udkadam
    • Joined on 02-08-2007, 9:10 AM
    • Posts 17
    try to use Javascript on every page of your application....whenever browser will get cloced,JS function will give call to the server,and then perform functionality you want.
  • Re: How to manage the Session_End Event at global.asax?

    02-09-2007, 9:32 PM
    • Loading...
    • aweil
    • Joined on 09-09-2005, 6:57 PM
    • Paris, France
    • Posts 118

    Hi,

    The Session_End event will fire when the user closes his browser, but only after the timeout has elapsed (by default, this is 20 minutes).

    If you need to catch that event instantly, use javascript to regularly ping the server, as was said.

    Hope this helps,

    Arnaud 

    Microsoft .net Training and Consulting
    http://www.dreamdotnet.com/
    Microsoft .net 3.0 Training and Consulting
    Filed under: ,
Page 1 of 1 (3 items)
Microsoft Communities
Page view counter