maxAge parameter in Hono Cookie Helper takes seconds?
I have a problem, I have a problem that seems to be solved, but to make sure I wanna ask if maxAge parameter in Hono Cookie Helper expects seconds and not milliseconds as in express cookie-parser?
4 Replies
the example shows a value of 1000, so i'd guess it's looking for ms
yeah, the helper just spreads in options directly: https://github.com/honojs/hono/blob/2ead4d8faa58d187bf7ec74bac2160bab882eab0/src/helper/cookie/index.ts#L78
protip: most hono files are no more than 100-200 lines. it's really easy to click through, as far as source code goes, and i've found them to be a great resource, both as a reference for hono helpers, and as a guide when building my own helpers or middleware
okay thanks
but I haven't really understood is that yes (in second) or no (in milliseconds)?
hono wants milliseconds
the underlying node + dom architecture for cookies uses milliseconds, so do hono + express
Okay, thank you very much for clarification