
Originally Posted by
djr33
Cookies can be deleted manually or automatically by the browser-- so you can't control that.
What you can do is suggest a time to delete it and the browser won't keep it after that.
In other words, you can set a long time and hope it stays that long. If you set no time, it will by default end when the current session ends-- either after a long period of inactivity or, as you've found, when the browser is restarted.
So the basic answer is to just set the time as long as you can. Often, people use one year: 365*24*60*60 (seconds in a year).
Bookmarks