title: Devise Rememberable not working after Chrome/Firefox browser applications closed
body: <p>In a <code>Rails 4.2</code> application, I have <code>Devise</code> installed on an application with the <code>Rememberable</code> and <code>Timeoutable</code> modules activated.</p>
  
  <p>When a user logs in, chooses <code>Remember Me</code>, and closes the browser <strong>tab</strong>, their login is retained when they open up a new <strong>tab</strong> and return to the application. This is consistent with Chrome, Firefox, and Safari.</p>
  
  <p>However, when a user logs in, chooses <code>Remember Me</code> and closes the browser <strong>app</strong>, they are logged out of the application when they re-open the browser <strong>app</strong> and open a new browser tab. This is consistent with Chrome and Firefox. Safari, on the other hand, works as desired.</p>
  
  <p>Is it possible to retain the user login credentials when a user closes the Chrome and Firefox browser <strong>apps</strong>? I suspect this is a cookie issue, but I don't know what settings I need to change to keep the cookie valid between browser <strong>app</strong> closings.</p>
  
  <p>The behavior is consistent between Windows and Mac platforms.</p>
  
  <h2>Configurations</h2>
  
  <h3>Chrome</h3>
  
  <pre><code>Settings &gt; Content settings &gt; Cookies &gt; Allow local data to be set = selected
  </code></pre>
  
  <h3>Server</h3>
  
  <ul>
  <li>Rails 4.2</li>
  <li>Devise 3.4.1</li>
  </ul>
  
  <h3>Client 1</h3>
  
  <ul>
  <li>Mac OSX 10.10.2 (Yosemite) </li>
  <li>Chrome 41.0.2272.101 (64-bit)</li>
  <li>Firefox 36.0.4</li>
  <li>Safari 8.0.4 (10600.4.10.7)</li>
  </ul>
  
  <h3>Client 2</h3>
  
  <ul>
  <li>Windows 7 </li>
  <li>Chrome  41.0.2272.101 m</li>
  <li>Firefox 36.0.4</li>
  </ul>
  
  <h3>User Model</h3>
  
  <pre><code># models/user.rb
  
  devise :database_authenticatable, :recoverable, :rememberable, :registerable, :trackable, :validatable, :async, :timeoutable
  </code></pre>
  
  <h3>Devise Config</h3>
  
  <pre><code># note: User model does have remember_created_at field installed
  
  # config/initializers/devise.rb
  
  Devise.setup do |config|
    ...
    config.remember_for = 2.weeks
    config.extend_remember_period = true
    config.rememberable_options = { secure: true }
    config.timeout_in = 2.weeks
    config.expire_auth_token_on_timeout = false
    ...
  end
  </code></pre>