What is the difference between cookies maxAge and expiry
cookies, express, node.js
Solution
As far as i know, `maxAge` wont save in cookie's specifications. As Don't trust Cookie setMaxAge demonstrated, The mechanism of `maxAge` works like Change/manipulate expiration date of cookie (based on SERVER_SIDE) but browser checks cookie's expiration date, based on CLIENT_SIDE. From my point of view, This is misbehavior. Because in order to make `max-age` work as expected, both client/server DateTime should be synchronized.
Problem
I'm on NodeJS, Express app i am using cookies for some features of my app. I need to set cookie life to one month. For this very purpose i've set cookie maxAge to `days*hoursPerDay*minutesPerHour*secondsPerMinute*1000` to achieve one month time `30*24*60*60*1000` = `2592000000`. Yet in browser expiry of my cookies is near 10 hours. What am i missing, my calculations are wrong? or I am using wrong attribute(`maxAge`)? Also what is the difference between `maxAge` and `expiry` attribute of cookies?