Skip to content

Commit

Permalink
fix(http): Add same site strict flag to session cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
pierwill committed Nov 12, 2020
1 parent fab99c9 commit 20818a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions http/session_handler.go
Expand Up @@ -176,9 +176,10 @@ func decodeCookieSession(ctx context.Context, r *http.Request) (string, error) {
// SetCookieSession adds a cookie for the session to an http request
func SetCookieSession(key string, r *http.Request) {
c := &http.Cookie{
Name: cookieSessionName,
Value: key,
Secure: true,
Name: cookieSessionName,
Value: key,
Secure: true,
SameSite: 3, // SameSiteStrictMode
}

r.AddCookie(c)
Expand Down

0 comments on commit 20818a9

Please sign in to comment.