Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First thing is to clear out which session store you're using to avoid "confusion". I guess the exercise uses the <strong>default (cookie) store</strong> but than of course you might have changed that already to <strong>active record store</strong> (or any other store that keeps the data on the server).</p> <p>Check your <code>config/initializers/session_store.rb</code> file to find out the session store being used. Assuming you did not change anything about the store it should be configured to <code>:cookie_store</code>, in that case you do not need to worry about anything as client side cookies are used to store session data and these cookies by default expire after the browser is closed (they're so called "session" cookies, just to be clear session here does refer to the cookie being present until your browsing session persist - closing the browser deletes the session cookie). Of course this does not call any of the server side code such as <code>sign_out</code> or <code>session.destroy</code> on browser exit, but as the cookie holds all the session data and is deleted by the browser you no longer can access it thus might consider the session destroyed ...</p> <p>Now, with server side session storage this gets more complicated, as mentioned in the previous answer <strong>"You can not 'force' the client to close a session"</strong>. What most people do is destroy "expired" sessions by hand e.g. <a href="http://guides.rubyonrails.org/security.html#session-expiry" rel="nofollow">http://guides.rubyonrails.org/security.html#session-expiry</a>. Sample rake task <a href="https://gist.github.com/kares/919069" rel="nofollow">https://gist.github.com/kares/919069</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload