Skip to content

Commit

Permalink
webserver: strict SameSite auth cookie attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed May 15, 2020
1 parent 7a31ee0 commit 73a3f78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/webserver/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,13 @@ func (s *WebServer) actuallyLogin(w http.ResponseWriter, r *http.Request, login
cval := s.auth()
http.SetCookie(w, &http.Cookie{
Name: authCK,
Path: "/",
Value: cval,
Path: "/",
// The client should only send the cookie with first-party requests.
// Cross-site requests should not include the auth cookie.
// https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1
SameSite: http.SameSiteStrictMode,
// Secure: false, // while false we require SameSite set
})
}
writeJSON(w, struct {
Expand Down

0 comments on commit 73a3f78

Please sign in to comment.