As mentioned in chapter 8 of Ruby on Rails Guide by Michael Hartl a session gets deleted when the browser window is closed. I have tried using both Chrome and Firefox but the session does not gets deleted.
I am using the following login helper function:
def log_in user
session[:user_id]=user.id
end
and the session_store.rb
file contains the following code:
Rails.application.config.session_store :cookie_store, key: '_sample_app_session'
I figured out that for a particular expiration time
:expire_after => 60.minutes
can be used but what is to be done if we want to expire the session as soon as the browser window is closed?