0

Internet Explorer is not saving cookie in jquery plugin

This apparently alerts the string

$.cookie('test', 'cookie saved', {
    expires : 30
});

alert($.cookie('test'))

But next time the page is opened this is undefined

alert($.cookie('test'))

Have tried to set the expires option to 999999999 and completely removed it.. Same result.. Cookie not saved... The string is alerted right after the cookie is set but next time it is undefined

clarkk
  • 27,151
  • 72
  • 200
  • 340
  • This should work. Have you got IE settings to allow cookies to be saved? – Rory McCrossan Feb 10 '14 at 12:24
  • yes cookies is enabled.. default settings – clarkk Feb 10 '14 at 12:29
  • Could IE [P3P Policy](http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer) be causing the problem? – Vikram Deshmukh Feb 10 '14 at 12:31
  • Have also removed the expires option.. same result.. cookie not saved.. the cookie is not saved in an ifrme but its on the `top` document – clarkk Feb 10 '14 at 12:34
  • @clarkk if this is in an iframe, you need to edit the question to add that – Adam Hopkinson Feb 10 '14 at 12:40
  • Sorry for asking the obvious but... Have you installed a cookie plug-in? Are you testing in a web server? Does it work with other browsers? – Álvaro González Feb 10 '14 at 13:02
  • yes.. The website is `live` on the server and it works in other browsers – clarkk Feb 10 '14 at 13:05
  • What's the URL? See any messages in IE12's F12 Developer tools console when you enable script debugging? – EricLaw Feb 10 '14 at 21:49
  • When you say "Next time you open the page", do you mean that you close your browser, or close the tab? I'm having a very similar problem, which only manifests when the browser window is closed, but doesn't exist when the tab is closed and a new tab to the page is opened. – Shotgun Ninja Mar 14 '14 at 13:56

0 Answers0