idle session

Discussion in 'ASP General' started by Iona, Sep 1, 2003.

  1. Iona

    Iona Guest

    Hi,

    usually session expires in 20 minutes, well mine is and I want to redirect the user to an error page telling them that their session has expired and they need to login again. How do I code that and where should I put it? Thanks.

    -----------------------------
    This message is posted by http://Asp.ForumsZone.com
    Iona, Sep 1, 2003
    #1
    1. Advertising

  2. Iona

    Ken Schaefer Guest

    You can't do that using ASP, since ASP runs on the server, and once a page
    is sent to the client, the server doesn't know anything about it anymore.

    Instead, you can create a client-side refresh, eg using a javascript
    timer -or- a meta refresh tag, that redirects the user after 20 minutes, eg:

    <head>
    <meta http-equiv="refresh" content="1200;URL=/loginpage.asp" />
    </head.

    Cheers
    Ken


    "Iona" <> wrote in message
    news:...
    : Hi,
    :
    : usually session expires in 20 minutes, well mine is and I want to redirect
    the user to an error page telling them that their session has expired and
    they need to login again. How do I code that and where should I put it?
    Thanks.
    :
    : -----------------------------
    : This message is posted by http://Asp.ForumsZone.com
    :
    Ken Schaefer, Sep 1, 2003
    #2
    1. Advertising

  3. Iona

    AHN Guest

    On some former page of your application start some session variable and at
    the top of the page, in server side code, check if the value you had set is
    still there. If the session is over, the variable will be empty, so your
    server will know the sesion is over and redirect the client if so. Cheers.

    "Iona" <> wrote in message
    news:...
    > Hi,
    >
    > usually session expires in 20 minutes, well mine is and I want to redirect

    the user to an error page telling them that their session has expired and
    they need to login again. How do I code that and where should I put it?
    Thanks.
    >
    > -----------------------------
    > This message is posted by http://Asp.ForumsZone.com
    >
    AHN, Sep 1, 2003
    #3
    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. Jeff Smythe
    Replies:
    3
    Views:
    1,238
    Jeff Smythe
    Jan 2, 2004
  2. gen_tricomi
    Replies:
    4
    Views:
    300
    gen_tricomi
    May 23, 2006
  3. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,267
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  4. Smokey Grindle

    get session idle time?

    Smokey Grindle, May 9, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    538
    Smokey Grindle
    May 14, 2007
  5. MAX2006
    Replies:
    5
    Views:
    5,417
    Allen Chen [MSFT]
    Apr 14, 2009
Loading...

Share This Page