Re: cookie expiry date 01/01/0001
From: Chris R. Timmons (crtimmons_at_X_NOSPAM_Xcrtimmonsinc.com)
Date: 04/22/04
- Next message: Vincent Finn: "Re: Turning off dynamic help inside VS .NET???"
- Previous message: Bob Rock: "Turning off dynamic help inside VS .NET???"
- In reply to: Ray: "Re: cookie expiry date 01/01/0001"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Apr 2004 10:35:23 -0700
=?Utf-8?B?UmF5?= <anonymous@discussions.microsoft.com> wrote in
news:48FC3104-D6A0-48A4-BED3-978CE0561A70@microsoft.com:
> HI, Chris:
>
> I had tried that.
> It still gives me 01/01/0001 when I displayed the expiry date
> from the cookie collection
Ray,
Exactly. The browser will not send the expiration date of the cookie
back to the server (I don't know why). So trying to read
Request.Cookies["demo"].Expires will never work.
If you only need to know if the cookie has expired or not, the
browser takes care of that by not sending the cookie if it has
expired. However, if you need to know how much time is remaining
before the cookie expires, then you probably need to store another
expiration date in a cookie value so you can read it:
Response.Cookies["demo].Values["expiration_date"] = ...
and
daysx.Text = Convert.ToString(
Request.Cookies["demo"].Values["expiration_date"]);
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
- Next message: Vincent Finn: "Re: Turning off dynamic help inside VS .NET???"
- Previous message: Bob Rock: "Turning off dynamic help inside VS .NET???"
- In reply to: Ray: "Re: cookie expiry date 01/01/0001"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|