aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web/Session.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-10 16:56:08 -0700
committerredmatrix <git@macgirvin.com>2016-04-10 16:56:08 -0700
commitabfbe9c9375c7505e0422b8adc1d9d5426d7df1a (patch)
tree5fdc9b9b7edbc4f73fd36cfde9d905e335089cb9 /Zotlabs/Web/Session.php
parentc0bdcfedeb8c5b8753587ac77d5b90d48698ec66 (diff)
downloadvolse-hubzilla-abfbe9c9375c7505e0422b8adc1d9d5426d7df1a.tar.gz
volse-hubzilla-abfbe9c9375c7505e0422b8adc1d9d5426d7df1a.tar.bz2
volse-hubzilla-abfbe9c9375c7505e0422b8adc1d9d5426d7df1a.zip
a few issues: block public not blocking mod_cal, typo in sql for one clone file sync operation, fix_system_urls not catching cached contact photos, extend sessionhandler expiration when remember_me is enabled as the stored session is expiring long before the browser session.
Diffstat (limited to 'Zotlabs/Web/Session.php')
-rw-r--r--Zotlabs/Web/Session.php29
1 files changed, 17 insertions, 12 deletions
diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php
index 494c02b1d..d25ce5f6a 100644
--- a/Zotlabs/Web/Session.php
+++ b/Zotlabs/Web/Session.php
@@ -13,6 +13,8 @@ namespace Zotlabs\Web;
class Session {
+ private static $handler = null;
+
function init() {
$gc_probability = 50;
@@ -26,6 +28,7 @@ class Session {
*/
$handler = new \Zotlabs\Web\SessionHandler();
+ self::$handler = $handler;
$x = session_set_save_handler($handler,true);
if(! $x)
@@ -67,26 +70,28 @@ class Session {
- function new_cookie($time) {
+ function new_cookie($xtime) {
+
+ $newxtime = (($xtime> 0) ? (time() + $xtime) : 0);
$old_sid = session_id();
session_regenerate_id(false);
- q("UPDATE session SET sid = '%s' WHERE sid = '%s'",
- dbesc(session_id()),
- dbesc($old_sid)
- );
+ if(self::$handler) {
+ $v = q("UPDATE session SET sid = '%s' WHERE sid = '%s'",
+ dbesc(session_id()),
+ dbesc($old_sid)
+ );
+ }
+ else
+ logger('no session handler');
if (x($_COOKIE, 'jsAvailable')) {
- if ($time) {
- $expires = time() + $time;
- } else {
- $expires = 0;
- }
- setcookie('jsAvailable', $_COOKIE['jsAvailable'], $expires);
+ setcookie('jsAvailable', $_COOKIE['jsAvailable'], $newxtime);
}
- setcookie(session_name(),session_id(),$expires);
+ setcookie(session_name(),session_id(),$newxtime);
+
}