Closed 4ov closed 3 years ago
Hey @4ov 👋
Looks like this error is coming from the std lib.
REF: https://deno.land/std@0.98.0/http/cookie.ts#L60
The git blame takes you to a PR where the author states that 0 is valid ( well, says negative values are invalid ) according to the RFC ( https://github.com/denoland/deno_std/pull/359#discussion_r279169244 ).
Indeed, the RFC states:
Max-Age=delta-seconds Optional. The Max-Age attribute defines the lifetime of the cookie, in seconds. The delta-seconds value is a decimal non- negative integer. After delta-seconds seconds elapse, the client should discard the cookie. A value of zero means the cookie should be discarded immediately.
REF: https://www.ietf.org/rfc/rfc2109.txt
So think this is a mistake in the http std lib - we should also raise an issue there. 😄
This has been fixed upstream, awaiting next deno_std
release.
So we are good here, Thanks.
Issue
Setup:
Details
res.cookie
'smaxAge
option can be 0 in express while it's giving an error in opine