BcUtil::getLoginUserSessionKey PHP Method

getLoginUserSessionKey() public static method

ログインしているユーザーのセッションキーを取得
public static getLoginUserSessionKey ( ) : string
return string
    public static function getLoginUserSessionKey()
    {
        list(, $sessionKey) = explode('.', BcAuthComponent::$sessionKey);
        return $sessionKey;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * ログインユーザーのデータを取得する
  * 
  * @return array
  */
 public static function loginUser()
 {
     $Session = new CakeSession();
     $sessionKey = BcUtil::getLoginUserSessionKey();
     $user = $Session->read('Auth.' . $sessionKey);
     if (!$user) {
         if (!empty($_SESSION['Auth'][$sessionKey])) {
             $user = $_SESSION['Auth'][$sessionKey];
         }
     }
     return $user;
 }
All Usage Examples Of BcUtil::getLoginUserSessionKey