Re: Global.asax Session_End

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



GregoryJ wrote:
Thanks for giving me this oversight even though I am in the wrong newsgroup. What you say makes sense.

Basically, I am evaluating the Session's state when I load my pages using a Cookie that holds some session related information.

Although I'm in the wrong place, can I ask one question about the Cookie.Expires method. If I set the Cookie to expire in 20 minutes,

Cookies with such a short expiration date doesn't work well. If the user is in a different time zone, the cookie will either last for hours or expire immediately.

what would be the best approach to keeping the session from expiring while someone is working in the application. My thought is that I'm going to reset the Expire minutes everytime a new page or transaction takes place. Good idea or bad?

Bad idea. Don't use the cookie expiration to keep track of the session timeout. Store the last request time in the cookie and set the expiration date to at least a day from now.

--
Göran Andersson
_____
http://www.guffa.com
.



Relevant Pages

  • Re: Session Question
    ... uses a session for authentication which will show up blank throughtout the ... referer and log it to a table in the database. ... Session cookies don't expire as long as the browser is open, ... Even if the cookie expired on the client, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: session question
    ... How is session expiration handled on server? ... Does programmer have any ... Can I programmatically "reset" the Session timer? ... > Session expiry isn't implemented using the cookie expiry. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Sessions vs Cookies
    ... There is a session cookie which simply allows the server to identify the client and retrieve relevant session data for it. ... If cookies can be read or forged, it makes little odds whether you have the master key or all the little keys,. ... Suppose you only send the PHPSESSID: Now you cannot change a thing on the server, even if you have the 'master key'. ...
    (comp.lang.php)
  • 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)
  • Re: Is it safe to store user_id in Session?
    ... What I was wondering is how safe it is to store user_id or username or ... session so I do not need to search the database all the time. ... OVERRIDING BASIC SESSION COOKIE AUTHENTICATION ... So what is described in the article only works for bad php scripts. ...
    (comp.lang.php)