/** * @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); }
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'); }
/** * @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; }