Closed kobevaliant closed 3 years ago
One usually can't deal with negative time periods so nobody knows what is a duration of -1 seconds.
According to MDN https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#Session_cookies
The cookie created above is a session cookie: it is deleted when the client shuts down, because it didn't specify an Expires or Max-Age directive.
So what you need is missing both Expires and MaxAge that you can achieve by setting duration
to null
.
Released in 1.3.0
Hi, I want the session deleted when user close browser, so I must set the cookie's maxAge to -1, but I don't know how to do it. The folowing code doesn't work
I find some code in ktor in
io.ktor.sessions.SessionTransportCookie
It seems that
expires
is set without considerring maxAge of -1?