Ejemplo n.º 1
0
 public function testRetrieveSpecificSessionIdName()
 {
     global $_COOKIE;
     $_COOKIE['AfsSessionId'] = 'youhou';
     $_COOKIE['myName'] = 'wouhahaha';
     $mgr = new AfsUserSessionManager('myName');
     $this->assertEquals('wouhahaha', $mgr->get_user_id());
 }
Ejemplo n.º 2
0
 /** @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;
 }