Skip Navigation LinksHome > Categories > Code from a Category

A simple function that shows how one can destroy a cookie



User Name: codelecturer
Name: Mike Chauhan
Contact Me: www.datawebcoder.com/ContactUs.aspx
Home Page: www.datawebcoder.com
6 years of total IT experience including programming, application development, System Maintenance . 3 years of Experienced and expertise in .Net Framework VB, Visual Basic.Net, ASP.Net 2.0, 3.5 and AD... [More]
Viewed Times: 2052
Add Date: 11/08/2011
Here is a small function I came up with which allows you to destroy a cookie. All that is needed is to pass the cookie name. If the cookie is found, it'll set it so that it has expired.
That's it. Just call this static function and your all set. If you are calling it from a regular class you may want to make it a non static method. I had this is a HttpHelper class, which I would just call by using HttpHelper.DestroyCookie("mycookiename")

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.