Answer the question
In order to leave comments, you need to log in
How to set session time in Ruby on Rails?
I store id users like this: session[:user_id] = id
And how to set the session time?
But I know how to set the time if using cookies, but is it possible to store the user id in cookies?
Answer the question
In order to leave comments, you need to log in
If you use session storage in cookies, then Rack::Session::Cookie is used to manage them in rails.
For configuration, edit config/initializers/session_store.rb
Application.config.session_store :cookie_store, key: '_name_session', expire_after: 24.hours
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question