ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Cookie.php
Go to the documentation of this file.
1<?php
2
20
32interface Cookie
33{
34 public const SAMESITE_NONE = 'None';
35 public const SAMESITE_LAX = 'Lax';
36 public const SAMESITE_STRICT = 'Strict';
37
41 public function getName(): string;
42
43
47 public function getValue(): ?string;
48
49
53 public function getExpires(): int;
54
55
60 public function getMaxAge(): int;
61
62
66 public function getPath(): ?string;
67
68
72 public function getDomain(): ?string;
73
74
78 public function getSecure(): bool;
79
80
84 public function getHttpOnly(): bool;
85
89 public function getSamesite(): ?string;
90
96 public function withValue(?string $value = null): Cookie;
97
98
108 public function withExpires($expires = null): Cookie;
109
110
114 public function rememberForLongTime(): Cookie;
115
116
121 public function expire(): Cookie;
122
123
130 public function withMaxAge(?int $maxAge = null): Cookie;
131
132
138 public function withPath(?string $path = null): Cookie;
139
140
146 public function withDomain(?string $domain = null): Cookie;
147
148
154 public function withSecure(?bool $secure = null): Cookie;
155
156
162 public function withHttpOnly(?bool $httpOnly = null): Cookie;
163
170 public function withSamesite(string $sameSite): Cookie;
171
177 public function __toString(): string;
178}
withPath(?string $path=null)
Sets the cookie path.
getHttpOnly()
True if the cookie is http only otherwise false.
withDomain(?string $domain=null)
Sets the domain name for the cookie.
rememberForLongTime()
Sets the expiration date to +5 years.
getExpires()
Expiration date as unix timestamp.
withSamesite(string $sameSite)
Sets the samesite attribute.
getValue()
Cookie value.
getDomain()
Cookie domain.
withValue(?string $value=null)
Sets the cookie value.
getSamesite()
Cookie samesite.
withExpires($expires=null)
Sets the expiration date of the cookie.
withMaxAge(?int $maxAge=null)
Maximal life time of the cookie in seconds.
withHttpOnly(?bool $httpOnly=null)
Sets if the cookie is http only.
expire()
Expire the cookie.
getMaxAge()
Max age measured in seconds.
withSecure(?bool $secure=null)
Sets if the cookie is a secure cookie or not.
getSecure()
True if it's secure cookie otherwise false.
__toString()
Returns the string representation of the object.
$path
Definition: ltiservices.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Cookie.php:19