title: Setting access token cookie in Loopback?
body: <p>I want to use cookies to keep a user logged in.</p>
  
  <p>On this page <a href="https://docs.strongloop.com/display/public/LB/Making+authenticated+requests" rel="noreferrer"><strong>here</strong></a> they say</p>
  
  <blockquote>
    <p>To use cookies for authentication, add the following to server.js
    (before boot):</p>
  
  <pre><code>app.use(loopback.token({ model: app.models.accessToken }));
  </code></pre>
  </blockquote>
  
  <p>Seemed simple enough. I figured the cookies were set by Loopback automatically during the login process but it's still not working, I check my cookies in Chrome dev tools and none are set.</p>
  
  <p>Am I missing something? Otherwise, what's the best way to hook into the login method to have set the cookie/header?</p>
  
  <p>I found docs on the <code>loopback.token()</code> method <a href="http://apidocs.strongloop.com/loopback/#loopback-token" rel="noreferrer"><strong>here</strong></a>, which says exactly where it checks for the token.</p>