setExpiration() public method

Sets the amount of time allowed between requests before the session will be terminated.
public setExpiration ( $time ) : self
return self
コード例 #1
0
 /**
  * @param string
  * @param string
  * @return void
  * @throws \Nette\InvalidStateException
  */
 private function setSession($uid, $word)
 {
     if (!self::$session) {
         throw new \Nette\InvalidStateException(__CLASS__ . ' session not found');
     }
     self::$session->{$uid} = $word;
     self::$session->setExpiration($this->getExpire(), $uid);
 }
コード例 #2
0
ファイル: EventsPresenter.php プロジェクト: soundake/pd
 public function handleAddTerm($event_id)
 {
     $this->session = $this->getSession('eventWizard');
     $this->session->setExpiration('+ 1 hour');
     if (!isset($this->session->event)) {
         $this->session->event['id'] = $event_id;
     }
     $this->event_id = $event_id;
     $this->redirect('eventWizardStep2');
 }
コード例 #3
0
ファイル: Configurator.php プロジェクト: kovkus/r-cms
 /**
  * @return Nette\Http\Session
  */
 public static function createServiceSession(DI\Container $container, array $options = NULL)
 {
     $session = new Nette\Http\Session($container->httpRequest, $container->httpResponse);
     $session->setOptions((array) $options);
     if (isset($options['expiration'])) {
         $session->setExpiration($options['expiration']);
     }
     return $session;
 }