Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
  • in reply to: Express.js Sessions – A Detailed Tutorial #152

    Thanks for the book is really grate.
    I wonder about the TTL. I can’t find a good and clear documentation for connect-mongo and ofte is confusing.”expires”, “originalMaxAge” and “cookie.expires”.
    It would be nice if you take a couple of examples how to configure the duration. I can see that MongoDB store the session like:
    “_id” : “jvi555cr9lQGe3+kR0Q0c/wP”,
    “session” : “{\”cookie\”:{\”originalMaxAge\”:65000,\”expires\”:\”2014-02-24T15:50:44.250Z\”,\”httpOnly\”:true,\”path\”:\”/\”},\”user\”:{\”firstName\”:\”Testman\”,\”lastName\”:\”testsson\”,\”email\”:\”\”,\”dbs\”:[{\"dbName\":\"PeersDB\"}]}}”,
    “expires” : ISODate(“2014-02-24T15:50:44.25Z”)
    After that time the document is deleted from the db.

    In this case I wrote after the log-on
    req.session.cookie.expires = 65000;

    But I still wonder. Must I regenerate the session ( I suppose if I don’t the session will end after the time). Please tell me how wrong I have.


Viewing 1 post (of 1 total)