diff --git a/api/ctx.md b/api/ctx.md index b8b186226e2..1a98cade0c1 100644 --- a/api/ctx.md +++ b/api/ctx.md @@ -318,15 +318,16 @@ func (c *Ctx) Cookie(cookie *Cookie) ```go type Cookie struct { - Name string `json:"name"` - Value string `json:"value"` - Path string `json:"path"` - Domain string `json:"domain"` - MaxAge int `json:"max_age"` - Expires time.Time `json:"expires"` - Secure bool `json:"secure"` - HTTPOnly bool `json:"http_only"` - SameSite string `json:"same_site"` + Name string `json:"name"` + Value string `json:"value"` + Path string `json:"path"` + Domain string `json:"domain"` + MaxAge int `json:"max_age"` + Expires time.Time `json:"expires"` + Secure bool `json:"secure"` + HTTPOnly bool `json:"http_only"` + SameSite string `json:"same_site"` + SessionOnly bool `json:"session_only"` } ``` diff --git a/api/middleware/csrf.md b/api/middleware/csrf.md index a25e1565888..8c6989e022e 100644 --- a/api/middleware/csrf.md +++ b/api/middleware/csrf.md @@ -88,6 +88,10 @@ type Config struct { // Optional. Default value "Lax". CookieSameSite string + // Decides whether cookie should last for only the browser sesison. + // Ignores Expiration if set to true + CookieSessionOnly bool + // Expiration is the duration before csrf token will expire // // Optional. Default: 1 * time.Hour diff --git a/original/context.md b/original/context.md index 20e779aa4d6..4772345735b 100644 --- a/original/context.md +++ b/original/context.md @@ -232,14 +232,15 @@ c.Cookie(*Cookie) ```go type Cookie struct { - Name string - Value string - Path string - Domain string - Expires time.Time - Secure bool - HTTPOnly bool - SameSite string // lax, strict, none + Name string + Value string + Path string + Domain string + MaxAge int + Expires time.Time + Secure bool + HTTPOnly bool + SameSite string // lax, strict, none } ```