curl http://localhost:3000 -v
* Trying 127.0.0.1:3000...
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.86.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< connection:keep-alive
< set-cookie:zap-cookie_1min=60; Max-Age=60; secure;
< set-cookie:zap-cookie_1h=3600; Max-Age=3600; secure;
< content-length:5
< date:Sat, 20 May 2023 17:56:28 GMT
< last-modified:Sat, 20 May 2023 17:56:28 GMT
<
* Connection #0 to host localhost left intact
Hello
As you can see, the cookies are set correctly. However, my server reports its
date
timestamp, that's generated by facilio, with 2h behind my current local
time. So it reports the time in UTC, not localtime.
Hence, Chrome shows the cookie as to expire in the past, because it displays server time. When I send a request to zap's cookie example, which prints all cookies, it shows: after 1min, the first cookie is gone, only the 1h cookie is sent by Chrome.
So it all works as expected. I had tested this before committing it to Zap. I use session cookies in my other projects, too, and they work as expected.