Probably not a very challenging question, but how the @#$% do you destroy a cookie?
I've tried:
response.cookie("Cookie") = nothing
response.cookie.remove("Cookie")
and a host of others!
Any help will be appreciated.
Probably not a very challenging question, but how the @#$% do you destroy a cookie?
I've tried:
response.cookie("Cookie") = nothing
response.cookie.remove("Cookie")
and a host of others!
Any help will be appreciated.
You have to expire them. You can also create session cookies. These cookies will destroy themselves when the session ends. In classic ASP, there is a "expires" property.
Hope this helps,
Danny
I've been having the same problem, and I almost went mad! Here's what finally worked for me:
Use Response.AppendCookie() to add a cookie with the same name as the cookie that you want to remove, and an expiration date that is in the past. For example (in C#):
HttpCookie objCookie= new HttpCookie("CookieName");
objCookie.Expires = DateTime.Today.AddYears(-1);
Response.AppendCookie(objCookie);
I was trying this same thing with the Response.Cookies.Add() method, and it seems like it used to work, but it doesn't now, so I've switched over to this way.
Hope this helps!
Corey
Become Part of This Conversation
Join NowFor Free!