Lines Matching refs:cookie

34         foreach ($cookieArray as $cookie) {
35 if (!($cookie instanceof SetCookie)) {
36 $cookie = new SetCookie($cookie);
38 $this->setCookie($cookie);
67 * @param SetCookie $cookie Being evaluated.
70 public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool argument
72 if ($cookie->getExpires() || $allowSessionCookies) {
73 if (!$cookie->getDiscard()) {
90 foreach ($this->cookies as $cookie) {
91 if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
92 return $cookie;
101 return \array_map(static function (SetCookie $cookie): array {
102 return $cookie->toArray();
115 static function (SetCookie $cookie) use ($domain): bool {
116 return !$cookie->matchesDomain($domain);
122 static function (SetCookie $cookie) use ($path, $domain): bool {
123 return !($cookie->matchesPath($path)
124 && $cookie->matchesDomain($domain));
130 static function (SetCookie $cookie) use ($path, $domain, $name) {
131 return !($cookie->getName() == $name
132 && $cookie->matchesPath($path)
133 && $cookie->matchesDomain($domain));
143 static function (SetCookie $cookie): bool {
144 return !$cookie->getDiscard() && $cookie->getExpires();
149 public function setCookie(SetCookie $cookie): bool argument
153 $name = $cookie->getName();
159 $result = $cookie->validate();
164 $this->removeCookieIfEmpty($cookie);
173 if ($c->getPath() != $cookie->getPath()
174 || $c->getDomain() != $cookie->getDomain()
175 || $c->getName() != $cookie->getName()
182 if (!$cookie->getDiscard() && $c->getDiscard()) {
189 if ($cookie->getExpires() > $c->getExpires()) {
195 if ($cookie->getValue() !== $c->getValue()) {
204 $this->cookies[] = $cookie;
225 foreach ($cookieHeader as $cookie) {
226 $sc = SetCookie::fromString($cookie);
276 foreach ($this->cookies as $cookie) {
277 if ($cookie->matchesPath($path)
278 && $cookie->matchesDomain($host)
279 && !$cookie->isExpired()
280 && (!$cookie->getSecure() || $scheme === 'https')
282 $values[] = $cookie->getName().'='
283 .$cookie->getValue();
296 private function removeCookieIfEmpty(SetCookie $cookie): void argument
298 $cookieValue = $cookie->getValue();
301 $cookie->getDomain(),
302 $cookie->getPath(),
303 $cookie->getName()