]> git.plutz.net Git - cgilite/blobdiff - session.sh
mime types for streaming formats
[cgilite] / session.sh
index ee5c4993a72df047fe0fc67b3c384f2b5733be48..12788d3eb534292349b8146ac1c50db80118398b 100755 (executable)
@@ -57,7 +57,7 @@ update_session(){
   local session sid time sig serverkey checksig
 
   IFS=- read -r sid time sig <<-END
-       $(COOKIE session)
+       $(POST session_key || COOKIE session)
        END
   serverkey="$(server_key)"
   
@@ -68,7 +68,7 @@ update_session(){
     -a "$time" -ge "$_DATE" \
     -a "$(printf %s "$sid" |checkid)" ] 2>&-
   then
-    debug Setting up new session
+    debug "Setting up new session"
     sid="$(randomid)"
   fi
 
@@ -78,6 +78,6 @@ update_session(){
   printf %s\\n "${sid}-${time}-${sig}"
 }
 
-SESSION_ID="$(update_session)"
-SET_COOKIE 0 session="$SESSION_ID" Path=/ SameSite=Strict HttpOnly
-SESSION_ID="${SESSION_ID%%-*}"
+SESSION_KEY="$(update_session)"
+SET_COOKIE 0 session="$SESSION_KEY" Path=/ SameSite=Strict HttpOnly
+SESSION_ID="${SESSION_KEY%%-*}"