forked from gorilla/sessions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for SameSite cookie attribute (gorilla#165)
Showing
3 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// +build !go1.11 | ||
|
||
package sessions | ||
|
||
// Options stores configuration for a session or session store. | ||
// | ||
// Fields are a subset of http.Cookie fields. | ||
type Options struct { | ||
Path string | ||
Domain string | ||
// MaxAge=0 means no Max-Age attribute specified and the cookie will be | ||
// deleted after the browser session ends. | ||
// MaxAge<0 means delete cookie immediately. | ||
// MaxAge>0 means Max-Age attribute present and given in seconds. | ||
MaxAge int | ||
Secure bool | ||
HttpOnly bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// +build go1.11 | ||
|
||
package sessions | ||
|
||
import "net/http" | ||
|
||
// Options stores configuration for a session or session store. | ||
// | ||
// Fields are a subset of http.Cookie fields. | ||
type Options struct { | ||
Path string | ||
Domain string | ||
// MaxAge=0 means no Max-Age attribute specified and the cookie will be | ||
// deleted after the browser session ends. | ||
// MaxAge<0 means delete cookie immediately. | ||
// MaxAge>0 means Max-Age attribute present and given in seconds. | ||
MaxAge int | ||
Secure bool | ||
HttpOnly bool | ||
// Defaults to http.SameSiteDefaultMode | ||
SameSite http.SameSite | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters