1

Browser Cookies: When I enter a invalid login Id I get an unauthorized cookie on my HTML page. I display the cookie value, But the cookie seems to a persistent one and it doesn't go even on a page refresh.how do I go about this? I even tried expiring them. It does not work.

Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
gurlInTheDark
  • 170
  • 1
  • 2
  • 10
  • You cannot remove cookie as such. Instead you can only work-around it like setting the cookie value to null. See : http://stackoverflow.com/questions/6876282/really-deleting-cookies-with-javascript – Roy M J Oct 23 '13 at 11:43
  • I tried all the methods said in the above links.. it creates a duplicate cookie if i try to set it to null – gurlInTheDark Oct 23 '13 at 11:46

1 Answers1

1
document.cookie = 'mycookie=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
  • thats already done.. despite the fact that the cookie is expired, its shown on the page. Seems more like a persistent cookie – gurlInTheDark Oct 23 '13 at 11:52