diff options
Diffstat (limited to 'shared/classes/session.php')
-rw-r--r-- | shared/classes/session.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/shared/classes/session.php b/shared/classes/session.php index e422b21..1233a71 100644 --- a/shared/classes/session.php +++ b/shared/classes/session.php @@ -33,18 +33,18 @@ class sql_session extends sql_row_obj { ); // Creates a new session for the user at $S['user'] with a unique id, sends a cookie to the user and returns true for success, false for failure static function create() { - global $S, $conf; + global $S; $id=null; while (!$id) { $id=randstring(30); - $r=$S['pdo']->query('SELECT * FROM `sessions` WHERE `id`="'.$id.'"'); + $r=query('SELECT * FROM `sessions` WHERE `id`="'.$id.'"'); if ($r->rowCount()) { $id=null; } } - $S['session']=new sql_session($id, $S['user']->id, time(), $conf['sessionlength']); - debug('setcookie', $conf['cookiename'].'='.$id); - if (setcookie($conf['cookiename'], $S['session']->id, time()+$conf['sessionlength'], $S['cookie_dir'], '', false, true)) { + $S['session']=new sql_session($id, $S['user']->id, time(), $S['conf']['sessionlength']); + debug('setcookie', $S['conf']['cookiename'].'='.$id); + if (setcookie($S['conf']['cookiename'], $S['session']->id, time()+$S['conf']['sessionlength'], $S['cookie_dir'], '', false, true)) { $S['session']->write(); return true; } else { |