From: Paul Hänsch Date: Mon, 13 Sep 2021 10:48:33 +0000 (+0200) Subject: allow suppression of default session cookie X-Git-Url: http://git.plutz.net/?a=commitdiff_plain;h=a76f6a5931782adbae717678f8f92569ed0d5bcb;hp=bcca3c04531619b1ed26fed0fd323623321e54e7;p=cgilite allow suppression of default session cookie --- diff --git a/session.sh b/session.sh index ca931fa..5b36ae0 100755 --- a/session.sh +++ b/session.sh @@ -114,6 +114,11 @@ SESSION_VAR() { fi } +SESSION_COOKIE() { + SET_COOKIE 0 session="$SESSION_KEY" Path=/ SameSite=Strict HttpOnly +} + SESSION_KEY="$(update_session)" -SET_COOKIE 0 session="$SESSION_KEY" Path=/ SameSite=Strict HttpOnly SESSION_ID="${SESSION_KEY%% *}" + +[ "$1" = nocookie ] || SESSION_COOKIE