How to delete the cookies in javascript?
(or) del_cookie() function?
Explanation
The del_cookie() function is used to delete the cookie in javascript. Deleting cookies is extremely simple, (i.e)set the cookie with an expiry date of one day ago.
Example
function del_cookie(name)
{
document.cookie = name +
'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
}
The above function deletes the name of the cookie which has been set already by setting the expiry date of the cookies one day before.
A Note
Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script.
Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.