javascript
Set a cookie that never expires using Javascript
You can not set a cookie that never expires but you can use the highest value possible for the expiration date.
document.cookie = "cookie_name=cookie_val; expires=Fri, 31 Dec 9999 21:10:10 GMT";
In the above code snippet, we have used year 9999 for a cookie to expire.
Was this helpful?
Similar Posts
- Set a cookie for whole domain in javascript
- Javascript function to get cookie value by name
- Get and set storage in chrome extension
- Set default date in Jquery UI datepicker
- Convert all characters to lowercase using toLowerCase() method in javascript
- Sort array using Array.sort() in javascript
- Get Pseudo elements using Javascript