connect-firebase icon indicating copy to clipboard operation
connect-firebase copied to clipboard

cookie.maxAge

Open fpereira1 opened this issue 10 years ago • 1 comments

Hi,

I am looking at how to set rolling option in with connect-firebase, but it seems that connect-firebase is re-utilising cookie.maxAge for the expires functionality, in other implementations (redis, mongo) this is a different setting (ttl).

Setting the cookie.maxAge gives an impression of the rolling session, but because it's also the cookie setting, it means the cookie is valid even after the browser is closed.

The changes would be as follows:

-        var expires = typeof sess.cookie.maxAge === 'number' ? (+new Date()) + sess.cookie.maxAge : (+new Date()) + oneDayInMilliseconds;
+        var expires = typeof this.ttl === 'number' ? ((+new Date()) + this.ttl) : (+new Date()) + oneDayInMilliseconds;

Is that a change you'd want to see as a PR?

Thanks

fpereira1 avatar Apr 22 '15 23:04 fpereira1

yes, if you could create a PR for it that would be great - thanks!

ca98am79 avatar Apr 24 '15 02:04 ca98am79