Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Why don't my cookies expire?

Posted 19 Apr 2004 22:48:25
1
has voted
19 Apr 2004 22:48:25 Jack Cider posted:
<%
Response.Buffer = True

Response.Cookies ("myname".Domain = "mysite.com"
Response.Cookies ("myname".Expires=NOW()

Response.Redirect("loginform.asp"
%>

I have this code as a small file called logoff.asp which I send users to via a link within a Response.Write statement. The idea is that a user clicks on a link to log off from my site, and the cookie with thier information is immediately deleted. I also tried the following line instead of the Expires=NOW() line:

Response.Cookies ("myname".Expires = Date-1
and
Response.Cookies ("myname".Expires = 1/1/1990

None of these options have worked yet. It seems that no matter what I do, the cookie doesn't expire. Is what I'm trying to do even possible? Any help is much appreciated.


Jack

Replies

Replied 20 Apr 2004 02:32:17
20 Apr 2004 02:32:17 Phil Shevlin replied:
try any of these formats

Response.Cookies("name".Expires = Date + 365
or
Response.Cookies("name".Expires = #January 01, 1999#
or
Response.Cookies("name".Expires = #01/01/1999#
or
Response.Cookies("name".Expires = #7/30/98 00:00:00#

Reply to this topic