Lines Matching defs:cookie

8  * Set values of an cookie.
17 protected $cookie = [];
20 * @param string $name The name of the cookie; may not be null or an empty string.
21 * @param string $value The cookie value; may not be null.
28 $this->cookie['name'] = $name;
29 $this->cookie['value'] = $value;
33 * @param array $cookieArray The cookie fields; must contain name and value.
44 $cookie = new self($cookieArray['name'], $cookieArray['value']);
47 $cookie->setPath($cookieArray['path']);
50 $cookie->setDomain($cookieArray['domain']);
53 $cookie->setExpiry($cookieArray['expiry']);
56 $cookie->setSecure($cookieArray['secure']);
59 $cookie->setHttpOnly($cookieArray['httpOnly']);
62 $cookie->setSameSite($cookieArray['sameSite']);
65 return $cookie;
85 * The path the cookie is visible to. Defaults to "/" if omitted.
103 * The domain the cookie is visible to. Defaults to the current browsing context's document's URL domain if omitted.
125 * The cookie's expiration date, specified in seconds since Unix Epoch.
143 * Whether this cookie requires a secure connection (https). Defaults to false if omitted.
161 * Whether the cookie is an HTTP only cookie. Defaults to false if omitted.
179 * The cookie's same-site value.
201 $cookie = $this->cookie;
202 if (!isset($cookie['secure'])) {
204 $cookie['secure'] = false;
207 return $cookie;
217 return isset($this->cookie[$offset]);
227 return $this->offsetExists($offset) ? $this->cookie[$offset] : null;
239 unset($this->cookie[$offset]);
241 $this->cookie[$offset] = $value;
252 unset($this->cookie[$offset]);
275 throw new InvalidArgumentException('Cookie value is required when setting a cookie');