1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 23:24:09 +00:00

Merge pull request #19 from edyu/master

cookie Max-Age should be set to -1 when invalidating the cookie
This commit is contained in:
Rene Schallner 2023-05-21 01:33:05 +02:00 committed by GitHub
commit 8aec624462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -408,7 +408,7 @@ pub fn UserPassSessionAuth(comptime Lookup: type, comptime lockedPwLookups: bool
if (r.setCookie(.{ if (r.setCookie(.{
.name = self.settings.cookieName, .name = self.settings.cookieName,
.value = "invalid", .value = "invalid",
.max_age_s = self.settings.cookieMaxAge, .max_age_s = -1,
})) { })) {
zap.debug("logout ok\n", .{}); zap.debug("logout ok\n", .{});
} else |err| { } else |err| {
@ -424,7 +424,7 @@ pub fn UserPassSessionAuth(comptime Lookup: type, comptime lockedPwLookups: bool
if (r.setCookie(.{ if (r.setCookie(.{
.name = self.settings.cookieName, .name = self.settings.cookieName,
.value = "invalid", .value = "invalid",
.max_age_s = self.settings.cookieMaxAge, .max_age_s = -1,
})) { })) {
zap.debug("logout ok\n", .{}); zap.debug("logout ok\n", .{});
} else |err| { } else |err| {