X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsession.php;h=df3871bd78913f540f6ea46e99b8cb5698d1bc85;hb=30efb0c1e641b0b9d3aa40a5a79897c6d06ac3ef;hp=6c32e299ff2a447a9b68229c5606b2483a865f5a;hpb=cb05801a9031254f5882038de07a3ee4d5f89dd0;p=friendica.git diff --git a/include/session.php b/include/session.php index 6c32e299ff..df3871bd78 100644 --- a/include/session.php +++ b/include/session.php @@ -6,12 +6,12 @@ $session_exists = 0; $session_expire = 180000; -if(! function_exists('ref_session_open')) { +if(! function_exists('ref_session_open')) { function ref_session_open ($s,$n) { return true; }} -if(! function_exists('ref_session_read')) { +if(! function_exists('ref_session_read')) { function ref_session_read ($id) { global $session_exists; if(x($id)) @@ -23,20 +23,20 @@ function ref_session_read ($id) { return ''; }} -if(! function_exists('ref_session_write')) { +if(! function_exists('ref_session_write')) { function ref_session_write ($id,$data) { global $session_exists, $session_expire; - if(! $id || ! $data) { - return false; + if(! $id || ! $data) { + return false; } $expire = time() + $session_expire; $default_expire = time() + 300; if($session_exists) - $r = q("UPDATE `session` - SET `data` = '%s', `expire` = '%s' - WHERE `sid` = '%s' LIMIT 1", + $r = q("UPDATE `session` + SET `data` = '%s', `expire` = '%s' + WHERE `sid` = '%s'", dbesc($data), dbesc($expire), dbesc($id)); else $r = q("INSERT INTO `session` @@ -46,18 +46,18 @@ function ref_session_write ($id,$data) { return true; }} -if(! function_exists('ref_session_close')) { +if(! function_exists('ref_session_close')) { function ref_session_close() { return true; }} -if(! function_exists('ref_session_destroy')) { +if(! function_exists('ref_session_destroy')) { function ref_session_destroy ($id) { q("DELETE FROM `session` WHERE `sid` = '%s'", dbesc($id)); return true; }} -if(! function_exists('ref_session_gc')) { +if(! function_exists('ref_session_gc')) { function ref_session_gc($expire) { q("DELETE FROM `session` WHERE `expire` < %d", dbesc(time())); q("OPTIMIZE TABLE `sess_data`");