Update documentation and remove hack fixed by upstream cookie library
This commit is contained in:
parent
8d4278bfd2
commit
34b194c770
2 changed files with 2 additions and 5 deletions
|
@ -171,7 +171,7 @@ If you use the ``cookie`` affinity type you can also specify the name of the coo
|
||||||
|
|
||||||
The NGINX annotation `nginx.ingress.kubernetes.io/session-cookie-path` defines the path that will be set on the cookie. This is optional unless the annotation `nginx.ingress.kubernetes.io/use-regex` is set to true; Session cookie paths do not support regex.
|
The NGINX annotation `nginx.ingress.kubernetes.io/session-cookie-path` defines the path that will be set on the cookie. This is optional unless the annotation `nginx.ingress.kubernetes.io/use-regex` is set to true; Session cookie paths do not support regex.
|
||||||
|
|
||||||
Use `nginx.ingress.kubernetes.io/session-cookie-samesite` to apply a `SameSite` attribute to the sticky cookie. Browser accepted values are `None`, `Lax`, and `Strict`. Some older browsers reject cookies with the more-recently-defined `SameSite=None`. To omit `SameSite=None` from these older browsers, add the annotation `nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"`.
|
Use `nginx.ingress.kubernetes.io/session-cookie-samesite` to apply a `SameSite` attribute to the sticky cookie. Browser accepted values are `None`, `Lax`, and `Strict`. Some browsers reject cookies with `SameSite=None`, including those created before the `SameSite=None` specification (e.g. Chrome 5X). Other browsers mistakenly treat `SameSite=None` cookies as `SameSite=Strict` (e.g. Safari running on OSX 14). To omit `SameSite=None` from browsers with these incompatibilities, add the annotation `nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"`.
|
||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
|
|
|
@ -54,15 +54,12 @@ function _M.set_cookie(self, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if cookie_samesite then
|
|
||||||
cookie_path = cookie_path .. "; SameSite=" .. cookie_samesite
|
|
||||||
end
|
|
||||||
|
|
||||||
local cookie_data = {
|
local cookie_data = {
|
||||||
key = self:cookie_name(),
|
key = self:cookie_name(),
|
||||||
value = value,
|
value = value,
|
||||||
path = cookie_path,
|
path = cookie_path,
|
||||||
httponly = true,
|
httponly = true,
|
||||||
|
samesite = cookie_samesite,
|
||||||
secure = ngx.var.https == "on",
|
secure = ngx.var.https == "on",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue