ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\HTTP\Cookies\Cookie Interface Reference
+ Inheritance diagram for ILIAS\HTTP\Cookies\Cookie:
+ Collaboration diagram for ILIAS\HTTP\Cookies\Cookie:

Public Member Functions

 getName ()
 Cookie name. More...
 
 getValue ()
 Cookie value. More...
 
 getExpires ()
 Expiration date as unix timestamp. More...
 
 getMaxAge ()
 Max age measured in seconds. More...
 
 getPath ()
 Cookie path. More...
 
 getDomain ()
 Cookie domain. More...
 
 getSecure ()
 True if it's secure cookie otherwise false. More...
 
 getHttpOnly ()
 True if the cookie is http only otherwise false. More...
 
 getSamesite ()
 Cookie samesite. More...
 
 withValue (string $value=null)
 Sets the cookie value. More...
 
 withExpires ($expires=null)
 Sets the expiration date of the cookie. More...
 
 rememberForLongTime ()
 Sets the expiration date to +5 years. More...
 
 expire ()
 Expire the cookie. More...
 
 withMaxAge (int $maxAge=null)
 Maximal life time of the cookie in seconds. More...
 
 withPath (string $path=null)
 Sets the cookie path. More...
 
 withDomain (string $domain=null)
 Sets the domain name for the cookie. More...
 
 withSecure (bool $secure=null)
 Sets if the cookie is a secure cookie or not. More...
 
 withHttpOnly (bool $httpOnly=null)
 Sets if the cookie is http only. More...
 
 withSamesite (string $sameSite)
 Sets the samesite attribute. More...
 
 __toString ()
 Returns the string representation of the object. More...
 

Data Fields

const SAMESITE_NONE = 'None'
 
const SAMESITE_LAX = 'Lax'
 
const SAMESITE_STRICT = 'Strict'
 

Detailed Description

Definition at line 32 of file Cookie.php.

Member Function Documentation

◆ __toString()

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

Returns the string representation of the object.

Returns
string String representation.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ expire()

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

Expire the cookie.

Useful if the cookie should be deleted at the client side.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\expire().

+ Here is the caller graph for this function:

◆ getDomain()

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

Cookie domain.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ getExpires()

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

Expiration date as unix timestamp.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ getHttpOnly()

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

True if the cookie is http only otherwise false.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ getMaxAge()

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

Max age measured in seconds.

If the max age is zero no max age is set.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ getName()

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

◆ getPath()

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

◆ getSamesite()

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

Cookie samesite.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ getSecure()

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

True if it's secure cookie otherwise false.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ getValue()

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

Cookie value.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ rememberForLongTime()

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

Sets the expiration date to +5 years.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ withDomain()

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

Sets the domain name for the cookie.

Parameters
null | string$domainCookie domain.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withDomain().

+ Here is the caller graph for this function:

◆ withExpires()

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

Sets the expiration date of the cookie.

If the cookie should be expired please use the expire function.

If the expires parameter equals null, then the expires key will be removed from the cookie.

Parameters
null | \DateTimeInterface | int | string$expiresThe expiration time of the Cookie.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withExpires().

+ Here is the caller graph for this function:

◆ withHttpOnly()

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

Sets if the cookie is http only.

Parameters
null | bool$httpOnlyhttp only flag.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withHttpOnly().

+ Here is the caller graph for this function:

◆ withMaxAge()

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

Maximal life time of the cookie in seconds.

The most browser prefer max age over expiration date.

Parameters
null | int$maxAgeLifetime in seconds.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withMaxAge().

+ Here is the caller graph for this function:

◆ withPath()

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

Sets the cookie path.

Parameters
null | string$pathThe cookie path.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withPath().

+ Here is the caller graph for this function:

◆ withSamesite()

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

Sets the samesite attribute.

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

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

◆ withSecure()

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

Sets if the cookie is a secure cookie or not.

Parameters
null | bool$secureSecure flag.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withSecure().

+ Here is the caller graph for this function:

◆ withValue()

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

Sets the cookie value.

Parameters
null | string$valueThe cookie value.

Implemented in ILIAS\HTTP\Cookies\CookieWrapper.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\withValue().

+ Here is the caller graph for this function:

Field Documentation

◆ SAMESITE_LAX

const ILIAS\HTTP\Cookies\Cookie::SAMESITE_LAX = 'Lax'

Definition at line 35 of file Cookie.php.

◆ SAMESITE_NONE

const ILIAS\HTTP\Cookies\Cookie::SAMESITE_NONE = 'None'

Definition at line 34 of file Cookie.php.

◆ SAMESITE_STRICT

const ILIAS\HTTP\Cookies\Cookie::SAMESITE_STRICT = 'Strict'

Definition at line 36 of file Cookie.php.


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