diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-17 18:32:08 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-17 18:32:08 +0000 |
commit | fa5a8fde4a378c4a4940eba323de7e2e61054d36 (patch) | |
tree | 7f5ef7767dfbc36b8e138e954e34a5adb41c696f /modules | |
parent | 130e26983aedac1e4bb9f26d6a82c629248075e8 (diff) |
Switch from cookie sessions to database sessions. We can't use cookie
sessions; it encodes all the value into the cookie which means
little/no security, transfer costs, and storage limits.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user/helpers/user.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 1667afd1..6248baab 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -60,7 +60,17 @@ class user_Core { * Make sure that we have a session and group_ids cached in the session. */ public static function load_user() { - $session = Session::instance(); + // This is one of the first session operations that we'll do, so it may fail if there's no + // install yet. Try to handle this situation gracefully expecting that the scaffolding will + // Do The Right Thing. + // + // @todo get rid of this extra error checking when we have an installer. + try { + $session = Session::instance(); + } catch (Exception $e) { + return; + } + if (!($user = $session->get("user"))) { $session->set("user", $user = user::guest()); } |