Saturday, May 30, 2009

What Can I Do With A Dummy Phone

ASP.NET: Be careful when you delete a cookie

Response.Cookies collection contains a method named Remove , which at first sight it seems the one to remove a cookie previously defined

Reponse.Cookies.Remove ("MyCookie")

Logical right? it turns out that the Remove method it does is delete the cookie from the cookie collection, but not physically removed, so that The following Request this cookie will be charged again.

some research it turned out that the easiest way of eliminating a cookie is to make it expire:

Response.Cookies ("MyCookie"). DateTime.Now.AddDays Expire = (-1)

Incredible right? as is typical of Microsoft! :):)

0 comments:

Post a Comment