Mahahari
Mahahari

Reputation: 1011

Setting session expire time - Sails.js

I have a web page that uses session variables. How can i set an expire time for a session? eg: after 15 minutes of inactivity , have to destroy the session.

I tried in config/session.js , but in vain.

As i am new to sails.js , please suggest how to achieve this.

Please help. Thanks a lot.

Upvotes: 4

Views: 3523

Answers (1)

bredikhin
bredikhin

Reputation: 9045

It should work with

module.exports.session = {
  // ...
  cookie: {
    maxAge: 15*60*1000
  }
}

in your config/session.js.

Upvotes: 4

Related Questions