/** * @param $token * @return UserSession */ public static function findByToken($token) { $record = UserSession::model()->find("token = ? AND expireDate > NOW() AND expired = 0", $token); if (!$record) { return null; } return $record; }
public function loadSession() { $hybridauth = $this->newAuth(); $model = UserSession::model()->findByPk(Yii::app()->user->id); $hybridauth_session_data = $model->hybridauth_session; // then call Hybrid_Auth::restoreSessionData() to get stored data $hybridauth->restoreSessionData($hybridauth_session_data); return $hybridauth; }