Reputation: 1754
I am new to Rails. We are using rails 3. I would like to know how I can set a configurable session timeout value for our Rails application.
Upvotes: 3
Views: 6706
Reputation: 28245
In Rails 3 config.action_controller.session does not work. You can configure the application's session data in the initializer file config/initializers/session_store.rb
MyApp::Application.config.session_store :cookie_store,
:key => '_my_session',
:expire_after => 30.minutes
Upvotes: 15
Reputation: 5791
In environment file set:
config.action_controller.session = { :key => 'whatever', :secret => 'nottellingyou', :expire_after => 30.minutes } OR session :session_key => 'my_session_key' session :session_expires => 1.day.from_now
Upvotes: 2