]> git.plutz.net Git - cgilite/commitdiff
allow suppression of default session cookie
authorPaul Hänsch <paul@plutz.net>
Mon, 13 Sep 2021 10:48:33 +0000 (12:48 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 13 Sep 2021 10:48:33 +0000 (12:48 +0200)
session.sh

index ca931fad9aa662ec338820bdc88be9f5018aba24..5b36ae032af4e818af91d4b73190a9f83614da15 100755 (executable)
@@ -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