aboutsummaryrefslogtreecommitdiffstats
path: root/include/session.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/session.php')
-rw-r--r--include/session.php28
1 files changed, 13 insertions, 15 deletions
diff --git a/include/session.php b/include/session.php
index 0a6576bdd..a8c466450 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')) {
+
function ref_session_open ($s,$n) {
return true;
-}}
+}
+
-if(! function_exists('ref_session_read')) {
function ref_session_read ($id) {
global $session_exists;
if(x($id))
@@ -21,9 +21,9 @@ function ref_session_read ($id) {
return $r[0]['data'];
}
return '';
-}}
+}
+
-if(! function_exists('ref_session_write')) {
function ref_session_write ($id,$data) {
global $session_exists, $session_expire;
if(! $id || ! $data) {
@@ -44,25 +44,25 @@ function ref_session_write ($id,$data) {
dbesc($id), dbesc($default_expire), dbesc($data));
return true;
-}}
+}
+
-if(! function_exists('ref_session_close')) {
function ref_session_close() {
return true;
-}}
+}
+
-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')) {
function ref_session_gc($expire) {
q("DELETE FROM `session` WHERE `expire` < %d", dbesc(time()));
q("OPTIMIZE TABLE `sess_data`");
return true;
-}}
+}
$gc_probability = 50;
@@ -71,6 +71,4 @@ ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', 1);
-session_set_save_handler ('ref_session_open', 'ref_session_close',
- 'ref_session_read', 'ref_session_write',
- 'ref_session_destroy', 'ref_session_gc');
+session_set_save_handler ('ref_session_open', 'ref_session_close', 'ref_session_read', 'ref_session_write', 'ref_session_destroy', 'ref_session_gc');