コード例 #1
0
 public function testRetrieveSessionId()
 {
     global $_COOKIE;
     $_COOKIE['AfsSessionId'] = 'youhou';
     $mgr = new AfsUserSessionManager();
     $this->assertEquals('youhou', $mgr->get_session_id());
 }
コード例 #2
0
ファイル: afs_query_base.php プロジェクト: antidot/php_api
 /** @brief Initializes user id and session id.
  *
  * These identifiers are initialized thanks to specific manager. Refers to
  * @a AfsUserSessionManager for more details. User and session identifiers
  * are updated with identifiers from AfsUserSessionManager when they are
  * available. Otherwise, query identifiers are not modified.
  *
  * @param $mgr [in] Instance of @a AfsUserSessionManager.
  *
  * @return current instance.
  */
 public function initialize_user_and_session_id(AfsUserSessionManager $mgr)
 {
     $user_id = $mgr->get_user_id();
     if (!empty($user_id)) {
         $this->set_user_id($user_id);
     }
     $session_id = $mgr->get_session_id();
     if (!empty($session_id)) {
         $this->set_session_id($session_id);
     }
     return $this;
 }