0

I've known that session cookies will expire in default when we closed a browser. But I wanted to add function "auto logout" when inactive in 3 hours, I've tried expire_after: 3.hours in session_store but now when I close the browser, cookie still alive in 3 hours then reopen browser it still there. How can I combine them together: close browser - logout and inactive in 3 hours - logout?

  • Does this help you? http://stackoverflow.com/questions/1232174/rails-cookies-set-start-date-and-expire-date – Brian May 27 '16 at 15:27

1 Answers1

0

You could try using javascript to both listen for the browser close event and expire the cookie.

Community
  • 1
  • 1
toddmetheny
  • 4,405
  • 1
  • 22
  • 39