0

I created a cookie with PHP like so:

setcookie('form_login', $_POST['form_login'], time()+3600, "/");

I am then trying to delete it using jQuery (jQuery Cookie):

$.removeCookie('form_login');

Doesn't work, cookie still there. Why?

drake035
  • 3,955
  • 41
  • 119
  • 229

1 Answers1

0

You can only delete cookies created by javascript. You can't delete cookies create by the server

view more here

Community
  • 1
  • 1
MH2K9
  • 11,951
  • 7
  • 32
  • 49
  • I should have added that I also tried exactly that with the same result. I edited my question accordingly. – drake035 Aug 17 '14 at 12:12
  • 1
    If you set the cookies HttpOnly they can't be read, modified or deleted by Javascript. – Charlotte Dunois Aug 17 '14 at 12:30
  • Figured out what's going on: cookie does get deleted, only Firefox, Preferences > Privacy > Remove individual cookies doesn't show the state of cookies in real time (which is extremely deceptive and annoying) – drake035 Aug 18 '14 at 17:04