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