code to handle session timeout?

Discussion in 'ASP .Net' started by D, Oct 16, 2003.

  1. D

    D Guest

    In my global.asax file, I have in Session_End(Object sender, EventArgs e)
    Server.Transfer("logon.aspx");

    Because I want to have my user relogon. But it simply does not work. I
    keep getting the null exception error because the Session no longer contains
    the object that I have stored. I am trying to redirect my user gracefully
    back to the login page with a message that informs them of the timeout.

    I know it is a simple thing, but still have not been able to work it. If
    Session_End in global.asax file does not serve this purpose, then what is it
    for???
     
    D, Oct 16, 2003
    #1
    1. Advertising

  2. D

    Natty Gur Guest

    Hi,


    Session_End is there for cleaning resources that you put inside session
    variables.
    Server.Transfer won't work because the session end event isn't connect
    to any request of the client (every request start context and session
    end don’t run in such a context. It fire when there isn’t any client
    request for predefine time) so there’s no one to transfer to.


    Natty Gur[MVP]
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Oct 16, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Do
    Replies:
    2
    Views:
    6,382
  2. Gaetan
    Replies:
    4
    Views:
    5,952
    Bruce Barker
    Oct 24, 2005
  3. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,293
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  4. Edward Rothwell

    Handle Session Timeout And Lost MemberID

    Edward Rothwell, Dec 6, 2004, in forum: ASP General
    Replies:
    12
    Views:
    273
    Evertjan.
    Dec 8, 2004
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,293
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page