What is the default expire time of a cookie in Rails (3.1.3)?
I have found documentation on how to set, how to retrieve, but I fail to see the default expire time.
The default time for a Cookie to expire is 30 minutes. The default Expires value for a cookie is not a static time, but it creates a Session cookie. This will stay active until the user closes their browser/clears their cookies. You can override this as required.
Cookies can expire. A cookie with no expiration date specified will expire when the browser is closed. These are often called session cookies because they are removed after the browser session ends (when the browser is closed). Cookies with an expiration date in the past will be removed from the browser.
You can extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the 'expires' attribute to a date and time.
To set a cookie so it expires at the end of the browsing session, simply OMIT the expiration parameter altogether. Save this answer.
By default, cookies expire at the end of the session (meaning when the user closes their browser).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With