ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\HTTP\Cookies\CookieWrapper Class Reference
+ Inheritance diagram for ILIAS\HTTP\Cookies\CookieWrapper:
+ Collaboration diagram for ILIAS\HTTP\Cookies\CookieWrapper:

Public Member Functions

 __construct (private SetCookie $cookie)
 CookieFacade constructor. More...
 
 getName ()
 
 getValue ()
 
 getExpires ()
 
 getMaxAge ()
 
 getPath ()
 
 getDomain ()
 
 getSecure ()
 
 getHttpOnly ()
 
 getSamesite ()
 Cookie samesite. More...
 
 withValue (?string $value=null)
 
 withExpires ($expires=null)
 
 rememberForLongTime ()
 
 expire ()
 
 withMaxAge (?int $maxAge=null)
 
 withPath (?string $path=null)
 
 withDomain (?string $domain=null)
 
 withSecure (?bool $secure=null)
 
 withHttpOnly (?bool $httpOnly=null)
 
 withSamesite (string $sameSite)
 Sets the samesite attribute. More...
 
 __toString ()
 
 getImplementation ()
 Returns the underlying implementation. More...
 

Additional Inherited Members

- Data Fields inherited from ILIAS\HTTP\Cookies\Cookie
const SAMESITE_NONE = 'None'
 
const SAMESITE_LAX = 'Lax'
 
const SAMESITE_STRICT = 'Strict'
 

Detailed Description

Definition at line 32 of file CookieWrapper.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\HTTP\Cookies\CookieWrapper::__construct ( private SetCookie  $cookie)

CookieFacade constructor.

Definition at line 37 of file CookieWrapper.php.

38  {
39  }

Member Function Documentation

◆ __toString()

ILIAS\HTTP\Cookies\CookieWrapper::__toString ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 221 of file CookieWrapper.php.

221  : string
222  {
223  return $this->cookie->__toString();
224  }

◆ expire()

ILIAS\HTTP\Cookies\CookieWrapper::expire ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 147 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\expire().

147  : Cookie
148  {
149  $clone = clone $this;
150  $clone->cookie = $this->cookie->expire();
151 
152  return $clone;
153  }
+ Here is the call graph for this function:

◆ getDomain()

ILIAS\HTTP\Cookies\CookieWrapper::getDomain ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 84 of file CookieWrapper.php.

84  : ?string
85  {
86  return $this->cookie->getDomain();
87  }

◆ getExpires()

ILIAS\HTTP\Cookies\CookieWrapper::getExpires ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 60 of file CookieWrapper.php.

60  : int
61  {
62  return $this->cookie->getExpires();
63  }

◆ getHttpOnly()

ILIAS\HTTP\Cookies\CookieWrapper::getHttpOnly ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 100 of file CookieWrapper.php.

100  : bool
101  {
102  return $this->cookie->getHttpOnly();
103  }

◆ getImplementation()

ILIAS\HTTP\Cookies\CookieWrapper::getImplementation ( )

Returns the underlying implementation.

Only for package/service internal use!!!

Definition at line 231 of file CookieWrapper.php.

231  : SetCookie
232  {
233  return $this->cookie;
234  }

◆ getMaxAge()

ILIAS\HTTP\Cookies\CookieWrapper::getMaxAge ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 68 of file CookieWrapper.php.

68  : int
69  {
70  return $this->cookie->getMaxAge();
71  }

◆ getName()

ILIAS\HTTP\Cookies\CookieWrapper::getName ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 44 of file CookieWrapper.php.

44  : string
45  {
46  return $this->cookie->getName();
47  }

◆ getPath()

ILIAS\HTTP\Cookies\CookieWrapper::getPath ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 76 of file CookieWrapper.php.

76  : ?string
77  {
78  return $this->cookie->getPath();
79  }

◆ getSamesite()

ILIAS\HTTP\Cookies\CookieWrapper::getSamesite ( )

Cookie samesite.

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 105 of file CookieWrapper.php.

References null.

105  : ?string
106  {
107  $samesite = $this->cookie->getSameSite();
108  return is_null($samesite) ? null : $samesite->asString();
109  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ getSecure()

ILIAS\HTTP\Cookies\CookieWrapper::getSecure ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 92 of file CookieWrapper.php.

92  : bool
93  {
94  return $this->cookie->getSecure();
95  }

◆ getValue()

ILIAS\HTTP\Cookies\CookieWrapper::getValue ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 52 of file CookieWrapper.php.

52  : ?string
53  {
54  return $this->cookie->getValue();
55  }

◆ rememberForLongTime()

ILIAS\HTTP\Cookies\CookieWrapper::rememberForLongTime ( )

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 136 of file CookieWrapper.php.

136  : Cookie
137  {
138  $clone = clone $this;
139  $clone->cookie = $this->cookie->rememberForever();
140 
141  return $clone;
142  }

◆ withDomain()

ILIAS\HTTP\Cookies\CookieWrapper::withDomain ( ?string  $domain = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 180 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\withDomain().

180  : Cookie
181  {
182  $clone = clone $this;
183  $clone->cookie = $this->cookie->withDomain($domain);
184 
185  return $clone;
186  }
+ Here is the call graph for this function:

◆ withExpires()

ILIAS\HTTP\Cookies\CookieWrapper::withExpires (   $expires = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 125 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\withExpires().

125  : Cookie
126  {
127  $clone = clone $this;
128  $clone->cookie = $this->cookie->withExpires($expires);
129 
130  return $clone;
131  }
+ Here is the call graph for this function:

◆ withHttpOnly()

ILIAS\HTTP\Cookies\CookieWrapper::withHttpOnly ( ?bool  $httpOnly = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 202 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\withHttpOnly().

202  : Cookie
203  {
204  $clone = clone $this;
205  $clone->cookie = $this->cookie->withHttpOnly($httpOnly);
206 
207  return $clone;
208  }
+ Here is the call graph for this function:

◆ withMaxAge()

ILIAS\HTTP\Cookies\CookieWrapper::withMaxAge ( ?int  $maxAge = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 158 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\withMaxAge().

158  : Cookie
159  {
160  $clone = clone $this;
161  $clone->cookie = $this->cookie->withMaxAge($maxAge);
162 
163  return $clone;
164  }
+ Here is the call graph for this function:

◆ withPath()

ILIAS\HTTP\Cookies\CookieWrapper::withPath ( ?string  $path = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 169 of file CookieWrapper.php.

References $path, and ILIAS\HTTP\Cookies\Cookie\withPath().

169  : Cookie
170  {
171  $clone = clone $this;
172  $clone->cookie = $this->cookie->withPath($path);
173 
174  return $clone;
175  }
$path
Definition: ltiservices.php:29
+ Here is the call graph for this function:

◆ withSamesite()

ILIAS\HTTP\Cookies\CookieWrapper::withSamesite ( string  $sameSite)

Sets the samesite attribute.

Parameters
string$sameSitevalue of the samesite attribute. Valid values are SAMESITE_LAX, SAMESITE_STRICT or SAMESITE_NONE

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 210 of file CookieWrapper.php.

210  : Cookie
211  {
212  $clone = clone $this;
213  $clone->cookie = $this->cookie->withSameSite(SameSite::fromString($sameSite));
214 
215  return $clone;
216  }

◆ withSecure()

ILIAS\HTTP\Cookies\CookieWrapper::withSecure ( ?bool  $secure = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 191 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\withSecure().

191  : Cookie
192  {
193  $clone = clone $this;
194  $clone->cookie = $this->cookie->withSecure($secure);
195 
196  return $clone;
197  }
+ Here is the call graph for this function:

◆ withValue()

ILIAS\HTTP\Cookies\CookieWrapper::withValue ( ?string  $value = null)

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 114 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\Cookie\withValue().

114  : Cookie
115  {
116  $clone = clone $this;
117  $clone->cookie = $this->cookie->withValue($value);
118 
119  return $clone;
120  }
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: