Using Cookies on your site

Writing Cookies on  your site

We explain in easy to understand terms, how you can write cookies


Reading Cookies you have set

An easy to follow guide to reading cookies you have set


Deleting Cookies you have set

Cookies cannot be deleted directly from a web page, you have to ‘expire’ them so that the browser can delete them for you


aboutcookies © 2012-2021 - Fortune Design by RichoSoft - All Rights Reserved | Terms of Use | Privacy Policy | Made by RichoSoft

Deleting Cookies (by script)

Here we will give a basic overview on how to delete a cookie that you set from a page on your site, from the same or another page on your site.

Javascript: In this example we will use javascript to delete the cookie.

Place this script in the <head> section of your page:

Then you can use the following code to read the cookie:

Deleting a Cookie is easy, you just write it again with an expiry date in the past. The cookie must have been written by a page on your site. You cannot delete cookies written by other sites.

To delete a cookie called ‘MyCookie’ that you wrote earlier with a value of ‘I have been here’ and an expiry date  in the future.

Simply use  SetCookie(‘MyCookie’,’Deleted’,-1);   (The value ‘Deleted’ can be anything you like it’s gonna disappear when the browser closes anyway).

The expiry date is set to -1 (24 hours ago) so when the browser closes the cookie will be deleted by the browser automatically.

You can also delete cookies with ASP and PHP scripts. (PHP scripts not covered here at present)


To delete a cookie called UserInfo in ASP, use something like:

Response.Cookies(“UserInfo”).Expires = Date() -1   (Expiry date set to 24 hours ago)