idle session

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Iona

    #1

    idle session

    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

    #2
    Re: idle session

    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;U RL=/loginpage.asp" />
    </head.

    Cheers
    Ken


    "Iona" <ionasiswandi@h otmail.com> wrote in message
    news:4968040964 20085@Asp.Forum sZone.com...
    : 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
    :


    Comment

    • AHN

      #3
      Re: idle session

      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" <ionasiswandi@h otmail.com> wrote in message
      news:4968040964 20085@Asp.Forum sZone.com...[color=blue]
      > Hi,
      >
      > usually session expires in 20 minutes, well mine is and I want to redirect[/color]
      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.[color=blue]
      >
      > -----------------------------
      > This message is posted by http://Asp.ForumsZone.com
      >[/color]


      Comment

      Working...