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