regenerateId() public method

Regenerates the session ID.
public regenerateId ( ) : void
return void
コード例 #1
0
ファイル: Storage.php プロジェクト: trejjam/authorization
 /**
  * Returns and initializes $this->sessionSection.
  * @return Nette\Http\SessionSection
  */
 protected function getSessionSection($need)
 {
     $ret = parent::getSessionSection($need);
     if (!is_null($ret)) {
         if ($ret->authenticated && $ret->identity->browser !== $this->browser->getName() && $ret->identity->browserVersion !== $this->browser->getVersion()) {
             $ret->authenticated = FALSE;
             $this->sessionHandler->regenerateId();
             $ret->reason = static::MANUAL;
             $ret->authTime = NULL;
         }
     }
     return $ret;
 }
コード例 #2
0
ファイル: UserStorage.php プロジェクト: AndrewCarterUK/http
 /**
  * Sets the authenticated status of this user.
  * @param  bool
  * @return self
  */
 public function setAuthenticated($state)
 {
     $section = $this->getSessionSection(TRUE);
     $section->authenticated = (bool) $state;
     // Session Fixation defence
     $this->sessionHandler->regenerateId();
     if ($state) {
         $section->reason = NULL;
         $section->authTime = time();
         // informative value
     } else {
         $section->reason = self::MANUAL;
         $section->authTime = NULL;
     }
     return $this;
 }