user2473975
user2473975

Reputation:

User session time out in rails 4

How to do user session time out in rails 4. I didn't use any gem for authentication. I do my authentication manually. Any Idea please. I have already tried following and it is not working.

in my session_store.rb file, i added.

key: '_Matchimi_session', expire_after: 1.minutes

Upvotes: 4

Views: 11945

Answers (2)

linkedlist
linkedlist

Reputation: 1

I have this in my session_store.rb (as the only line):

Rails.application.config.session_store :cookie_store, key: '_my_session', :expire_after => 1.minutes

I have tested it, it works.

(I presume this is configured not for a specific app, but for all)

I have rails 4.2.3.

Upvotes: 0

user3038228
user3038228

Reputation: 112

You can configure the application's session information in the initializer file config/initializers/session_store.rb

YourApp::Application.config.session_store :cookie_store, 
  :key => '_my_session', 
  :expire_after => 30.minutes

see answer here

Upvotes: 8

Related Questions