config: add cookie_same_site option (#4148)

This commit is contained in:
Caleb Doxsey 2023-05-03 14:36:42 -06:00 committed by GitHub
parent facf9ab093
commit be0104b842
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 562 additions and 423 deletions

View file

@ -42,6 +42,7 @@ type Options struct {
Expire time.Duration
HTTPOnly bool
Secure bool
SameSite http.SameSite
}
// A GetOptionsFunc is a getter for cookie options.
@ -92,6 +93,7 @@ func (cs *Store) makeCookie(value string) *http.Cookie {
HttpOnly: opts.HTTPOnly,
Secure: opts.Secure,
Expires: timeNow().Add(opts.Expire),
SameSite: opts.SameSite,
}
}