Results 1 to 3 of 3

Thread: Session End Event

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    134

    Resolved Session End Event

    Hi all,

    I'm a bit weak in ASP.NET. Hence I need some help in this. how to fire the session_end event when the browser is closed so that i can write some cleanup code like formauthentication.signout etc.,

    Hope u all understood wot i want.. though i am brief and little unclear in the explanation.
    Last edited by pavan; Jan 11th, 2005 at 03:04 AM.
    Pavan Kumar

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: Session End Event

    No events are triggered when the browser is closed. HTTP is a stateless protocol so you will never know when the browser is gone.
    If you have stored data in your Session, you can use the Session_End event in global.asax yourself.

    Or alternatively, when users are browsing the site you could check if Session("authenticated") = True, and if not, or its equal to vbNullString, then they're either not authenticated or their Session variable has timed out and was automatically removed.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Re: Session End Event

    I have heard of it working, but only spotty at best. But as plenderj said, the browser really doesn't have to report back. What if it crashes? Don't ever count on this event to work right when the browser closes. Count on it firing after the session times out instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width