DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Session OnEnd

  1. #1
    ASHBeN Guest

    Session OnEnd


    Why does the Session OnEnd event takes a few minutes to get triggered? As
    soon as the browser is closed or a timeout occures the Session OnEnd event
    in the global.asa should fire and execute any code inside teh subroutine.
    But, when I put this thing to test (with some code in the Sub) the code executes
    but only a few minutes after the session has already ended (browser closed
    or timeout etc).

    Any clue to what's going on here. The MSDN or IIS documentation doesnt say
    much except that one statement : " ... the Session OnEnd event might not
    fire at times specially during timeouts ..."

    ;-)

  2. #2
    Brian Orrell Guest

    Re: Session OnEnd

    You should never rely upon on Session OnEnd or Application OnEnd. You can't
    rely that they will get run at the end. If the server crashes or gets
    restarted or whatever... those events WILL not fire.

    Timeouts generally will not run them either. "Cleanup" code or other things
    that you would generally do in a client/server environment upon exiting
    should not be relied upon in web development. Use stateless methodologies
    to aleviate having to clean up after long sessions.

    -Brian Orrell
    BrianOrrell@hotmail.com
    Manager
    Tactica Technology Group

    "ASHBeN" <test@tester.com> wrote in message news:395a3512@news.devx.com...
    >
    > Why does the Session OnEnd event takes a few minutes to get triggered? As
    > soon as the browser is closed or a timeout occures the Session OnEnd event
    > in the global.asa should fire and execute any code inside teh subroutine.
    > But, when I put this thing to test (with some code in the Sub) the code

    executes
    > but only a few minutes after the session has already ended (browser closed
    > or timeout etc).
    >
    > Any clue to what's going on here. The MSDN or IIS documentation doesnt say
    > much except that one statement : " ... the Session OnEnd event might not
    > fire at times specially during timeouts ..."
    >
    > ;-)




  3. #3
    Sharon Guest

    Re: Session OnEnd


    Hi

    Session_OnEnd does not fire instantaneously, when the client closes the browser
    or moves to another site. It waits until Session.timeout, which is 20 min.
    by default. However, it would fire instantaneously if the session is abandoned
    explicitly - session.abandon.

    sharon

    "ASHBeN" <test@tester.com> wrote:
    >
    >Why does the Session OnEnd event takes a few minutes to get triggered? As
    >soon as the browser is closed or a timeout occures the Session OnEnd event
    >in the global.asa should fire and execute any code inside teh subroutine.
    >But, when I put this thing to test (with some code in the Sub) the code

    executes
    >but only a few minutes after the session has already ended (browser closed
    >or timeout etc).
    >
    >Any clue to what's going on here. The MSDN or IIS documentation doesnt say
    >much except that one statement : " ... the Session OnEnd event might not
    >fire at times specially during timeouts ..."
    >
    >;-)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center