Results 1 to 3 of 3

Thread: [2005] Session End .NET 2.0 Global.asax

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2005
    Posts
    625

    [2005] Session End .NET 2.0 Global.asax

    Does the session_end function in Global.asax fire when the session times out or when the person on the page clicks something after the session times out?

    For example, would this work in Global.Asax :

    Sub Session_End
    Response.Redirect("./LoggedOut.aspx")
    End Sub

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [2005] Session End .NET 2.0 Global.asax

    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Session End .NET 2.0 Global.asax

    That won't work in global.asax because it's a server side event and is only raised when the 'session' object on the server ends or times out and as such cannot really be used to move the user elsewhere (since the session end may occur when the user is on a lunch break).

    Instead, you will need to put that logic in your master page or base page or a header or a security module somewhere; check if the session exists and if it doesn't, response.redirect.

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