The life span of JavaScript cookies depends on how long you set when creating cookies for example the following set a lifetime of 10 minutes. There is no way to get the cookie without expiration, i.e. you can set a life time cookie.
expiry = new Date();
expiry.setTime(date.getTime()+(10*60*1000));
// Ten minutes
// Date()'s toGMTSting() method will format the date correctly for a cookie
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The life span of JavaScript cookies depends on how long you set when creating cookies for example the following set a lifetime of 10 minutes. There is no way to get the cookie without expiration, i.e. you can set a life time cookie.
// Ten minutes
// Date()'s toGMTSting() method will format the date correctly for a cookie