del_cookie() Function

How to delete the cookies in javascript?
(or) del_cookie() function?


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.
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.

Ask Questions

Ask Question