Exemplo n.º 1
0
 /**
  * Save any new cookies, or cookies to be removed, as HTTP headers
  * @return boolean
  */
 public function save()
 {
     $cookies = $this->fresh->getArrayCopy();
     foreach ($cookies as $key => $value) {
         $cookie = $this->stringify($this->config['prefix'] . $key, $value);
         var_dump($cookie);
         header('Set-Cookie: ' . $cookie, false);
     }
 }
Exemplo n.º 2
0
 /**
  * Set a key value pair
  * @param  mixed $key   The key
  * @param  mixed $value The value
  */
 public function offsetSet($key, $value)
 {
     return parent::offsetSet($key, is_array($value) ? new ArrayObject($value) : $value);
 }
Exemplo n.º 3
0
 /**
  * Gets a parameter or the closure defining an object.
  * @param string $key The unique identifier for the parameter or object
  * @return mixed The value of the parameter or the closure defining an object
  * @throws \InvalidArgumentException if the identifier is not defined
  */
 public function raw($key)
 {
     if (!isset($this->keys[$key])) {
         throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $key));
     }
     if (isset($this->raw[$key])) {
         return $this->raw[$key];
     }
     return parent::offsetGet($key);
 }