aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2014-01-17 07:56:34 +0100
committerzottel <github@zottel.net>2014-01-17 07:56:34 +0100
commita0d6d3c7f9bf3de97fcf9544631eca45ca2d4cb3 (patch)
treefa2ee24f83ce5a9745ff84748822aad5888d8ffb /include
parent359d7980292490da370e49b5f3583d801157b5b7 (diff)
downloadvolse-hubzilla-a0d6d3c7f9bf3de97fcf9544631eca45ca2d4cb3.tar.gz
volse-hubzilla-a0d6d3c7f9bf3de97fcf9544631eca45ca2d4cb3.tar.bz2
volse-hubzilla-a0d6d3c7f9bf3de97fcf9544631eca45ca2d4cb3.zip
set jsAvailable cookie expire time to match PHPSESSID's
Diffstat (limited to 'include')
-rw-r--r--include/session.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/session.php b/include/session.php
index 6072bdb33..be1ec5ee7 100644
--- a/include/session.php
+++ b/include/session.php
@@ -15,6 +15,15 @@ function new_cookie($time) {
session_regenerate_id(false);
q("UPDATE session SET sid = '%s' WHERE sid = '%s'", dbesc(session_id()), dbesc($old_sid));
+
+ if (x($_COOKIE, 'jsAvailable')) {
+ if ($time) {
+ $expires = time() + $time;
+ } else {
+ $expires = 0;
+ }
+ setcookie('jsAvailable', $_COOKIE['jsAvailable'], $expires);
+ }
}