setExpiration() публичный Метод

Sets the expiration of the section or specific variables.
public setExpiration ( $time, $variables = NULL ) : self
Результат self
Пример #1
0
 /**
  * @param PayPal $payPal
  * @param Session $session
  */
 public function __construct(PayPal $payPal, Session $session)
 {
     parent::__construct();
     $this->payPal = $payPal;
     $this->session = $session->getSection('PayPalExpress');
     $this->session->setExpiration('+10 minutes');
     if (empty($this->session->token)) {
         $this->session->token = $this->_ec = Strings::random(6);
     }
 }
Пример #2
0
 public function __construct(Nette\Http\SessionSection $shopCart, Trejjam\Utils\Labels\Labels $labels, Nette\Security\User $user)
 {
     $this->shopCart = $shopCart;
     $this->shopCart->setExpiration('14 days');
     $this->labels = $labels;
     $this->user = $user;
     if (isset($this->shopCart->_userId) && $this->shopCart->_userId != $this->user->getId()) {
         $this->cartClear();
     }
     if (!isset($this->shopCart->_userId)) {
         $this->shopCart->_userId = $this->user->getId();
     }
 }
Пример #3
0
 /**
  * Optional, if you set Session than enable automatic language dection.
  *
  * @param Http\Session $session
  * @return self
  */
 public function setSession(Http\Session $session, $live = '+1 week')
 {
     $this->section = $session->getSection(__CLASS__);
     if (!isset($this->section->language)) {
         $this->setLanguage($this->detectLanguage());
         $this->section->setExpiration($live);
     }
     return $this;
 }