Re: session question

From: Patrick Y. Ng \(ms\) (patng@microsoft.com)
Date: 07/23/02


From: "Patrick Y. Ng \(ms\)" <patng@microsoft.com>
Date: Mon, 22 Jul 2002 15:49:18 -0700


(a) It's because no expiration date is set on the session id cookie
(b) Session expiry isn't implemented using the cookie expiry. It's
implemented on the server side. (Consider the case where cookieless is
used) Session.Timeout gives you the expiry period in minutes.

--
Patrick Y. Ng
ASP.NET Developer
This posting is provided “AS IS” with no warranties, and confers no rights.
"San" <sanjay_nadimpalli@yahoo.com> wrote in message
news:eRpWvpcMCHA.668@tkmsftngp09...
> I have the following two lines of code that get called on every http
> request:
>
> HttpCookie cookie =
> HttpContext.Current.Request.Cookies["ASP.NET_SessionId"];
>
> Response.AppendToLog("Cookie expires on date:" + cookie.Expires);
>
> The expiration time on cookie ASP.NET_SessionId is always January 1, 0001,
> 12 AM.  Two things:
>
> (a)  Why is it initialized to Jan 1, 2001 12 AM?
>
> (b) Shouldnt the cookie expiration change whenever the user makes a
request
> (within the 20 minute interval, assuming session timeout is set to 20
> minutes).
>
> Thanks
>
> San
>
>
>
>


Relevant Pages

  • Cookie not persisted w/o call to GetRedirectUrl()
    ... one as I am using multiple roles and I want to redirect the user after ... FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, ... HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, ... Set the expiration for the cookie that contains the ticket ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Cookie not persisted w/o call to GetRedirectUrl()
    ... >one as I am using multiple roles and I want to redirect the user after ... > HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, ... > 2) Tell the ticket that is persistent ... > 3) Set the expiration for the cookie that contains the ticket ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • 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: forms authentication question
    ... sliding timeout or absolute timeout, but my problem is that the ... sliding expiration does not get updated all the time. ... So, if I set the sliding expiration to 20 minutes, the cookie will be updated after 10 minutes, and if the user did something in the first 10 minutes, but then didn't do anything for the next 15 minutes, forms authentication cookie will be timed-out. ... Storing custom session key in the cookie gives me an ability to renew the cookie as long as the session key has not expired. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Need Help with cookies
    ... expiration of the cookie when modifying it's value. ... This leads to another question I had, which is about the expiration date. ... > // Check to see if there is even an instance of the cookie LoginStatus ... so complete the login process ...
    (microsoft.public.dotnet.framework.aspnet)