If I do session[:greeting] = "Hi!"
in one controller action, for how long will I be able to refer to session[:greeting]
in other controller actions?
Until the user closes his browser?
Until a certain amount of time passes?
Also, how can I configure this value?
Until the user closes her browser. That's the definition of a session.
To configure something longer, you will need to use one of:
Often there's a combination of these, where the user is given a "remember me" token as a cookie, so that they don't have to log in every time they restart the browser.
It is available until 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