Skip to content

Commit

Permalink
fix(middleware/session): CookieSameSite default "Lax" (#1638)
Browse files Browse the repository at this point in the history
* CookieSameSite default "Lax"

* Update README.md

* CookieSameSite default "Lax"

* Revert "CookieSameSite default "Lax""

This reverts commit 4141877.
  • Loading branch information
sixcolors committed Dec 2, 2021
1 parent af6b204 commit 693f3c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions middleware/session/README.md
Expand Up @@ -140,8 +140,8 @@ type Config struct {
// Optional. Default value false.
CookieHTTPOnly bool

// Indicates if CSRF cookie is HTTP only.
// Optional. Default value false.
// Sets the CSRF cookie SameSite attribute.
// Optional. Default value "Lax".
CookieSameSite string

// KeyGenerator generates the session key.
Expand Down
1 change: 0 additions & 1 deletion middleware/session/session.go
Expand Up @@ -202,7 +202,6 @@ func (s *Session) setSession() {
fcookie.SetSecure(s.config.CookieSecure)
fcookie.SetHTTPOnly(s.config.CookieHTTPOnly)

// TODO Default value should be set to `strict` in fiber v3.
switch utils.ToLower(s.config.CookieSameSite) {
case "strict":
fcookie.SetSameSite(fasthttp.CookieSameSiteStrictMode)
Expand Down

0 comments on commit 693f3c5

Please sign in to comment.