title: Change cookie expiration in Express
body: <p>Because I didn't define a maxAge when calling <code>expressServer.use(express.session({params}))</code> the cookie's expiration is set as "Session".</p>
  
  <p>I would like to add a "remember me" feature when logging in.  If "remember me" is selected, the expiration will be extended to a month.</p>
  
  <p>How would I go about doing this?  I tried simply extending the maxAge, but that didn't seem to do anything...</p>
  
  <pre><code>expressServer.get '/blah', (request, response) =&gt;
      request.session.cookie.maxAge = 2592000
      response.end 'hello there'
  </code></pre>
  
  <p>Thanks for the help!</p>
  
  <p>** <strong>EDIT</strong> **</p>
  
  <p>I tried making a simple server to test updating a user's cookie.  I'm using Express 3.0.4</p>
  
  <p>When I visit 127.0.0.1:9000/blah, the browser cookie's "expires" field is still "session"...</p>
  
  <pre><code>express = require 'express'
  
  expressServer = express()
  expressServer.use express.cookieParser()
  expressServer.use express.session
      secret: 'supersecret'
      cookie:
          path: '/'
          httpOnly: true
  
  expressServer.get '/', (request, response) =&gt;
      response.end 'hello'
  
  expressServer.get '/blah', (request, response) =&gt;
      request.session.cookie.maxAge = 3600000
      response.end 'hello again'
  
  expressServer.listen 9000
  console.log 'server running'
  </code></pre>
  
  <p>Grrrrrrr....</p>