ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Cookie.php
Go to the documentation of this file.
1 <?php
2 
20 
32 interface 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 }
withSamesite(string $sameSite)
Sets the samesite attribute.
__toString()
Returns the string representation of the object.
withMaxAge(int $maxAge=null)
Maximal life time of the cookie in seconds.
withPath(string $path=null)
Sets the cookie path.
withSecure(bool $secure=null)
Sets if the cookie is a secure cookie or not.
expire()
Expire the cookie.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Cookie.php:19
$path
Definition: ltiservices.php:32
getDomain()
Cookie domain.
withValue(string $value=null)
Sets the cookie value.
withHttpOnly(bool $httpOnly=null)
Sets if the cookie is http only.
rememberForLongTime()
Sets the expiration date to +5 years.
getName()
Cookie name.
getHttpOnly()
True if the cookie is http only otherwise false.
getSecure()
True if it&#39;s secure cookie otherwise false.
getValue()
Cookie value.
getExpires()
Expiration date as unix timestamp.
getPath()
Cookie path.
getMaxAge()
Max age measured in seconds.
withExpires($expires=null)
Sets the expiration date of the cookie.
getSamesite()
Cookie samesite.
withDomain(string $domain=null)
Sets the domain name for the cookie.