Re: Expired Session Variables

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: J. Baute (WUPYRDEDAWJD_at_spammotel.com)
Date: 03/29/04


Date: Mon, 29 Mar 2004 09:51:39 +0200


"Keith" <@.> wrote in message news:eUVLqB3EEHA.3372@TK2MSFTNGP10.phx.gbl...
> I want to do this to check when the username session variable has expired,
> and thus their login session has expired. Then I will redirect them to a
> different page than if they simplu had not logged in.

A common way to do this is simply redirect every expired or not logged in
user to the same login page, cause there isn't really a way to detect the
difference.

Something that could work to some degree is accompany your session cookie
(managed by ASP) with a custom cookie which expires "later" than your
session cookie.
Let's say your session expired after 20 minutes. You could create another
cookie which expires after 30 minutes, which you use to check if the user
logged on in the last 30 minutes. This gives you a timeframe of 10 minutes
where your expired session will be detected. After those 30 minutes, the
user will be considered as "never logged in".

But personnaly I wouldn't bother doing this, I think it will only confuse
the user.



Relevant Pages

  • Question about redirecting to a "session expired" page...
    ... When a logged in user's session expires, I want that user redirected back to ... "AuthCookie" that gets set when you use the FormsAuthentication class? ... means the session expired and it would redirect back to the login page. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Avoiding page expiry?
    ... >:I'm using a webform that expires after a few minutes. ... On submitting the form after the expiry time any data is lost. ... session is regarded as being inactive while you fill out the form. ...
    (comp.security.misc)
  • Re: Random Session Expiration
    ... mentioned random. ... > Shrinivas Reddy wrote: ... >> I am working on ASP.NET application in which the session expires randomly on ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: session wont timeout
    ... Maybe this is a session cookie issue? ... client browser there is this one: WSS_KeepSessionAuthenticated Expires: At ... If I kill the session cookie using IE Developer Toolbar, ... possible and IIS would throw another challenge. ...
    (microsoft.public.sharepoint.windowsservices)
  • Sessions and expiring cookies
    ... I set my session parameter so the session is a few minutes long, ... user goes inactive for that period the session expires. ... browser, since that might be subverted or buggy. ...
    (comp.lang.php)