Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can javascript delete a cookie set by http header?

I try to delete cookie set by http header but doesn't work. What's the different between http-set cookie and javascript-set cookie ?

like image 927
HOT.CHO Avatar asked Mar 14 '13 11:03

HOT.CHO


1 Answers

Yes, javascript can delete a cookie set by HTTP headers unless it is specifically a HTTPOnly cookie.

The cookie must also be from the same domain as the javascript.

See also http://www.quirksmode.org/js/cookies.html and Clearing all cookies with JavaScript

like image 156
penguat Avatar answered Oct 22 '22 21:10

penguat