Use signed cookie

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-06 08:33:38 +01:00
parent 13153e8f85
commit d4723024a0

View File

@@ -6,9 +6,12 @@ import (
// setSessionCookie sets a session cookie in the response
func setSessionCookie(w http.ResponseWriter, sessionID string, cfg AuthConfig) {
// Sign the session ID
signedValue := signCookieValue(sessionID, cfg.CookieSecret)
cookie := &http.Cookie{
Name: cfg.CookieName,
Value: sessionID,
Value: signedValue,
Path: cfg.CookiePath,
Domain: cfg.CookieDomain,
Secure: cfg.CookieSecure,