ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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 (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...
 

Private Attributes

SetCookie $cookie
 

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 ( SetCookie  $cookie)

CookieFacade constructor.

Definition at line 39 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\CookieWrapper\$cookie.

40  {
41  $this->cookie = $cookie;
42  }

Member Function Documentation

◆ __toString()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 224 of file CookieWrapper.php.

224  : string
225  {
226  return $this->cookie->__toString();
227  }

◆ expire()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 150 of file CookieWrapper.php.

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

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

◆ getDomain()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 87 of file CookieWrapper.php.

87  : ?string
88  {
89  return $this->cookie->getDomain();
90  }

◆ getExpires()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 63 of file CookieWrapper.php.

63  : int
64  {
65  return $this->cookie->getExpires();
66  }

◆ getHttpOnly()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 103 of file CookieWrapper.php.

103  : bool
104  {
105  return $this->cookie->getHttpOnly();
106  }

◆ getImplementation()

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

Returns the underlying implementation.

Only for package/service internal use!!!

Definition at line 234 of file CookieWrapper.php.

References ILIAS\HTTP\Cookies\CookieWrapper\$cookie.

234  : SetCookie
235  {
236  return $this->cookie;
237  }

◆ getMaxAge()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 71 of file CookieWrapper.php.

71  : int
72  {
73  return $this->cookie->getMaxAge();
74  }

◆ getName()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 47 of file CookieWrapper.php.

47  : string
48  {
49  return $this->cookie->getName();
50  }

◆ getPath()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 79 of file CookieWrapper.php.

79  : ?string
80  {
81  return $this->cookie->getPath();
82  }

◆ getSamesite()

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

Cookie samesite.

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 108 of file CookieWrapper.php.

108  : ?string
109  {
110  $samesite = $this->cookie->getSameSite();
111  return is_null($samesite) ? null : $samesite->asString();
112  }

◆ getSecure()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 95 of file CookieWrapper.php.

95  : bool
96  {
97  return $this->cookie->getSecure();
98  }

◆ getValue()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 55 of file CookieWrapper.php.

55  : ?string
56  {
57  return $this->cookie->getValue();
58  }

◆ rememberForLongTime()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 139 of file CookieWrapper.php.

139  : Cookie
140  {
141  $clone = clone $this;
142  $clone->cookie = $this->cookie->rememberForever();
143 
144  return $clone;
145  }

◆ withDomain()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 183 of file CookieWrapper.php.

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

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

◆ withExpires()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 128 of file CookieWrapper.php.

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

128  : Cookie
129  {
130  $clone = clone $this;
131  $clone->cookie = $this->cookie->withExpires($expires);
132 
133  return $clone;
134  }
+ 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 205 of file CookieWrapper.php.

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

205  : Cookie
206  {
207  $clone = clone $this;
208  $clone->cookie = $this->cookie->withHttpOnly($httpOnly);
209 
210  return $clone;
211  }
+ 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 161 of file CookieWrapper.php.

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

161  : Cookie
162  {
163  $clone = clone $this;
164  $clone->cookie = $this->cookie->withMaxAge($maxAge);
165 
166  return $clone;
167  }
+ 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 172 of file CookieWrapper.php.

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

172  : Cookie
173  {
174  $clone = clone $this;
175  $clone->cookie = $this->cookie->withPath($path);
176 
177  return $clone;
178  }
$path
Definition: ltiservices.php:32
+ 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 213 of file CookieWrapper.php.

213  : Cookie
214  {
215  $clone = clone $this;
216  $clone->cookie = $this->cookie->withSameSite(SameSite::fromString($sameSite));
217 
218  return $clone;
219  }

◆ withSecure()

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

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 194 of file CookieWrapper.php.

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

194  : Cookie
195  {
196  $clone = clone $this;
197  $clone->cookie = $this->cookie->withSecure($secure);
198 
199  return $clone;
200  }
+ 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 117 of file CookieWrapper.php.

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

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

Field Documentation

◆ $cookie

SetCookie ILIAS\HTTP\Cookies\CookieWrapper::$cookie
private

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