/** * Saves the logged-in User into Session and Cookie * @param boolean $soft do soft log-in (resets cookie if exists) */ static function SetCurrent($user, $soft = false) { // correct class & extend $user = AppUser::FindById($user->class, $user->id, true, true); // cookie if (Url::GetRequest(AppUser::REMEMBER_ME, false) || $soft && AppUser::GetCookie()) { AppUser::SetCookie($user); } // session AppUser::SetSession($user); // return return AppUser::Clean($user); }