From 02313315afc40aa8d56daac75bb717ba2b1d612a Mon Sep 17 00:00:00 2001 From: catfromplan9 <104175360+catfromplan9@users.noreply.github.com> Date: Sun, 11 May 2025 12:08:42 +0000 Subject: [PATCH] handler: Add Max-Age to cookies (#32) Add Max-Age to checkpoint-token cookie, so that the cookie persists after the end of the current session. --- src/core/Handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index 196e7d9..ddd0774 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -317,7 +317,7 @@ void CServerHandler::challengeSubmitted(const Pistache::Http::Request& req, Pist } response.headers().add( - std::make_shared(std::string{TOKEN_COOKIE_NAME} + "=" + TOKEN.tokenCookie() + "; Domain=" + hostDomain + "; HttpOnly; Path=/; Secure; SameSite=Lax")); + std::make_shared(std::string{TOKEN_COOKIE_NAME} + "=" + TOKEN.tokenCookie() + "; Domain=" + hostDomain + "; Max-Age=" + std::to_string(g_pConfig->m_config.token_valid_for) + "; HttpOnly; Path=/; Secure; SameSite=Lax")); if (js) response.send(Pistache::Http::Code::Ok, "Ok");