Results 1 to 5 of 5

Thread: Session_End

  1. #1

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Session_End

    When is the Session_End() event fired?
    I knocked out this code...
    PHP Code:
            protected void Session_End(Object senderEventArgs e)
            {
                
    FileStream fStream = new FileStream("C:\\out.txt",FileMode.Create);
                
    ASCIIEncoding ascEnc = new ASCIIEncoding();
                
    fStream.Write(ascEnc.GetBytes("end event."),0,"end event.".Length);
                
    fStream.Close();
            } 
    And something similar in the Session_Start event, but this one never fired after I navigated away from the page. Am I missing something?
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  2. #2
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774

    Re: Session_End

    Originally posted by sunburnt
    And something similar in the Session_Start event, but this one never fired after I navigated away from the page. Am I missing something?
    The Session ends after a set period of in-activity. Not when the user leaves your site. I believe the default is 20 minutes. That would be 20 minutes after the last activity at your site.

    They could leave your site, turn the computer off, go upstairs, have a quick shower and get dressed, and that Session could still be valid.

  3. #3

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    Well bah ; how am I supposed to determine when my user leaves the page, so I can clean up after them?
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  4. #4
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Originally posted by sunburnt
    Well bah ; how am I supposed to determine when my user leaves the page, so I can clean up after them?

    Well.....there is a Page_Unload event.

    You don't want to clean up after your users if all they did is click a popup do you ?? The 20 minute timeframe before sessions being ended is a sensible compromise. It gives the user breathing room yet allows you to clean up eventually.

    Try searching at DotNet Solutions

    It's the archive for several .NET mail lists. Lots 'o information to be found there.

    John

  5. #5

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    Thanks for your help. I'm not used to this web-based idea; I guess I'll have to start thinking about things differently than I normally do
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

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