diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-26 13:42:03 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-26 13:42:03 +0100 |
| commit | 7e340dacafb3b0758cc4641e4ab2630b04177bab (patch) | |
| tree | cbe587dc8e073f24c1ee18f87b1a0bcec6a45ace /src/routes | |
| parent | 88443bbc2d4a4825dbcfd0bff107a3ed23c82aac (diff) | |
auth: set max-age property on set-cookie to make session last
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/handler-info.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/routes/handler-info.zig b/src/routes/handler-info.zig index 95720b9..ca4babd 100644 --- a/src/routes/handler-info.zig +++ b/src/routes/handler-info.zig @@ -130,7 +130,10 @@ pub fn handle( if (context.response.headers.fingerprint) |auth_token| { var value = std.Io.Writer.Allocating.init(arena.allocator()); - try value.writer.print("fingerprint={s}; Secure; Path=/", .{auth_token}); + try value.writer.print("fingerprint={s}; Secure; Path=/; Max-Age={}", .{ + auth_token, + storage.config.session_expires_after / std.time.ns_per_s, + }); try headers.append(allocator, .{ .name = "Set-Cookie", |