diff options
author | friendica <info@friendica.com> | 2013-05-05 19:34:56 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-05-05 19:34:56 -0700 |
commit | 6f04a7e07033c8ca06df47defe1839d5763f1ee6 (patch) | |
tree | 8ea9d590d84335ef5eaa60a66eb1a707c46276ff /include/session.php | |
parent | ef07b71bc7972f79a7e5c1001a8c31d75b0cca68 (diff) | |
download | volse-hubzilla-6f04a7e07033c8ca06df47defe1839d5763f1ee6.tar.gz volse-hubzilla-6f04a7e07033c8ca06df47defe1839d5763f1ee6.tar.bz2 volse-hubzilla-6f04a7e07033c8ca06df47defe1839d5763f1ee6.zip |
minor fixes related to postgres development
Diffstat (limited to 'include/session.php')
-rw-r--r-- | include/session.php | 28 |
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'); |