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
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)"
" "*) 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)"
\\*) in="${in#\\}" ;;
*) out="${out}${in%%[\\+]*}"; in="${in#"${in%%[\\+]*}"}" ;;
esac; done
- printf '%s' "$out"
+ printf '%s\n' "$out"
}
DBM() {