From: Paul Hänsch Date: Mon, 13 Sep 2021 17:38:52 +0000 (+0200) Subject: Merge commit '8be698d02f663e3d88ef4c48adb00707d75eeaa4' X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=3c0572e592c39a0e7d4d6794b0fb68cf4719a79f;hp=-c;p=serve0 Merge commit '8be698d02f663e3d88ef4c48adb00707d75eeaa4' --- 3c0572e592c39a0e7d4d6794b0fb68cf4719a79f diff --combined cgilite/session.sh index ca931fa,5b36ae0..5b36ae0 --- a/cgilite/session.sh +++ b/cgilite/session.sh @@@ -114,6 -114,11 +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 diff --combined cgilite/storage.sh index 77ee29c,22e6acc..22e6acc --- a/cgilite/storage.sh +++ b/cgilite/storage.sh @@@ -66,11 -66,6 +66,6 @@@ RELEASE() fi } - # STRING=' - # s;\\;\\\\;g; s;\t;\\t;g; - # s;\n;\\n;g; s;\r;\\r;g; - # s;\+;\\+;g; s; ;+;g; - # ' STRING(){ local in out='' [ $# -gt 0 ] && in="$*" || in="$(cat)" @@@ -83,19 -78,9 +78,9 @@@ " "*) out="${out}+"; in="${in# }" ;; *) out="${out}${in%%[\\${CR}${BR} + ]*}"; in="${in#"${in%%[\\${BR}${CR} + ]*}"}" ;; esac; done - printf '%s' "$out" + printf '%s' "${out:-\\}" } - UNSTRING=' - :UNSTRING_X - s;((^|[^\\])(\\\\)*)\\n;\1\n;g; - s;((^|[^\\])(\\\\)*)\\t;\1\t;g; - s;((^|[^\\])(\\\\)*)\\r;\1\r;g; - s;((^|[^\\])(\\\\)*)\+;\1 ;g; - tUNSTRING_X; - s;((^|[^\\])(\\\\)*)\\\+;\1+;g; - s;\\\\;\\;g; - ' UNSTRING(){ local in out='' [ $# -gt 0 ] && in="$*" || in="$(cat)" @@@ -109,7 -94,7 +94,7 @@@ \\*) in="${in#\\}" ;; *) out="${out}${in%%[\\+]*}"; in="${in#"${in%%[\\+]*}"}" ;; esac; done - printf '%s' "$out" + printf '%s\n' "$out" } DBM() {