Take the 2-minute tour ×

I am using cookie plug in my application. where i display some information from cookies. it is working fine with firefox, but have some issues with IE. It works fine if i open a new tab in IE, it shows values from cookies, but if i close IE browser window it clears all cookies. this is not the case with mozilla, every time i open mozilla it shows those specific values from cookies. below is the code i use to set/get cookies.

function setCookies(){<br/>      
   return true;<br/>
}); <br/>
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You are not setting an expiry and by default cookies should expire on browser close. I'm not sure why Mozilla isn't doing this which is the real bug.


$.cookie(COOKIE_NAME, VALUE, { expires: 10 }); /* Expires in 10 days */
share|improve this answer
Thank you dear, it worked. –  azazi Jun 30 '10 at 8:59
add comment

Cookies are volatile - depending on the browser settings, they may get cleared when the browser closes. You can set up Firefox to do this, so it isn't unique to Internet Explorer. However, you may find some benefit to setting a long expiry on the cookies to ask the browser to keep them.

If you want to keep information, you need to do that in a database on your server, as you know it won't be cleared out!

share|improve this answer
add comment

Your Answer


