How to set the end time of a rail session cookie to a "session"

I do not really understand the details of Rails that are not on the surface.

All I want is to have a session cookie that expires before session , so it expires when the user leaves their browser or something else. As a measure of security.

+6
source share
2 answers

By default, a cookie is a session cookie. You have full control over the cookie by providing a hash of parameters in config/initializers/session_store.rb . Parameters are the same as Rack::Session::Cookie ( see Docs ). For example, for a specific expiration date, you can provide :expire_after .

If you use Devise and rememberable , then there is another cookie that can be used to extract the user.

+11
source

You can customize it. Take a look at these links.

+4
source

Source: https://habr.com/ru/post/927671/


All Articles