mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-22 23:05:18 -04:00
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.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user