mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Clarify Set-Cookie syntax
This commit is contained in:
parent
5f21d3f630
commit
2699aa8db7
1 changed files with 6 additions and 6 deletions
12
helpers.lua
12
helpers.lua
|
@ -145,10 +145,10 @@ function set_auth_cookie(user, domain)
|
|||
"|"..session_key)
|
||||
local cookie_str = "; Domain=."..domain..
|
||||
"; Path=/"..
|
||||
"; Expires="..os.date("%a, %d %b %Y %X UTC;", expire)..
|
||||
"; Expires="..os.date("%a, %d %b %Y %X UTC", expire)..
|
||||
"; Secure"..
|
||||
"; HttpOnly"..
|
||||
"; SameSite=Strict"
|
||||
"; SameSite=Strict ;;"
|
||||
|
||||
ngx.header["Set-Cookie"] = {
|
||||
"SSOwAuthUser="..user..cookie_str,
|
||||
|
@ -162,14 +162,14 @@ end
|
|||
function delete_cookie()
|
||||
conf = config.get_config()
|
||||
|
||||
local expired_time = "Thu, 01 Jan 1970 00:00:00 UTC;"
|
||||
local expired_time = "Thu, 01 Jan 1970 00:00:00 UTC"
|
||||
for _, domain in ipairs(conf["domains"]) do
|
||||
local cookie_str = "; Domain=."..domain..
|
||||
"; Path=/"..
|
||||
"; Expires="..expired_time..
|
||||
"; Secure"..
|
||||
"; HttpOnly"..
|
||||
"; SameSite=Strict"
|
||||
"; SameSite=Strict ;;"
|
||||
ngx.header["Set-Cookie"] = {
|
||||
"SSOwAuthUser="..cookie_str,
|
||||
"SSOwAuthHash="..cookie_str,
|
||||
|
@ -181,12 +181,12 @@ end
|
|||
|
||||
-- Expires the redirection cookie
|
||||
function delete_redirect_cookie()
|
||||
local expired_time = "Thu, 01 Jan 1970 00:00:00 UTC;"
|
||||
local expired_time = "Thu, 01 Jan 1970 00:00:00 UTC"
|
||||
local cookie_str = "; Path="..conf["portal_path"]..
|
||||
"; Expires="..expired_time..
|
||||
"; Secure"..
|
||||
"; HttpOnly"..
|
||||
"; SameSite=Strict"
|
||||
"; SameSite=Strict ;;"
|
||||
ngx.header["Set-Cookie"] = "SSOwAuthRedirect=;" ..cookie_str
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue