Add annotation for setting sticky cookie domain (#9088)
This adds the new annotation `nginx.ingress.kubernetes.io/session-cookie-domain` for setting the cookie `Domain` attribute of the sticky cookie. Signed-off-by: Matthias Neugebauer <mtneug@mailbox.org> Signed-off-by: Matthias Neugebauer <mtneug@mailbox.org>
This commit is contained in:
parent
077c0414aa
commit
26fe69cb47
9 changed files with 74 additions and 1 deletions
|
|
@ -110,6 +110,10 @@ function _M.set_cookie(self, value)
|
|||
cookie_data.max_age = tonumber(self.cookie_session_affinity.maxage)
|
||||
end
|
||||
|
||||
if self.cookie_session_affinity.domain and self.cookie_session_affinity.domain ~= "" then
|
||||
cookie_data.domain = self.cookie_session_affinity.domain
|
||||
end
|
||||
|
||||
local ok
|
||||
ok, err = cookie:set(cookie_data)
|
||||
if not ok then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue