I'm trying to learn the "cookie-session" module for Node. https://github.com/expressjs/cookie-session
I have a hard time understanding how to pass options for the cookie. For example expiration. Default seems to be a year!
This is the instructions about options for the cookie:
"Other options are passed to cookies.get()
and cookies.set()
allowing you to control security, domain, path, and signing among other settings."
But i dont get it!
Am I supposed to require cookies module as well?
Or do I somehow change the options trough var session = require('cookie-session')
?
I have tried session.cookies.set()
, but that doesnt seems to work.
I have tried to read the sourcecode in the "cookie-session" and "cookies" module for clues, but I dont know what to look for!