ASP and Cookies

They have: 330 posts

Joined: Apr 2000

I am having a pretty simple problem but I can't locate the fix. I am setting cookies with 2 keys to each user. I am trying to delete them and it seems to be working. When I try to run the if statement to see if it .haskeys it responds as it it does. How do I make the keys delete instead of setting them to ""?

Right now I'm deleting them like this...

Response.Cookies("Monster").Expires = Date - 1
'

Thanks for any help.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Well, my book tell me that setting the cookies to "" removes them.

If you want to see if a cookie exists, they say to check it against "" ....

<%
IF (Request.Cookies("Cookie_Name") = "") THEN
  'cookie exist
ELSE
  'cookie doesn't exist
END IF
%>
'

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.