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

Public Member Functions

 create (string $name, ?string $value=null)
 Create a new cookie with the given name and value.
Parameters
string$nameThe unique cookie name.
null | string$valueCookie value.
More...
 
 createRememberedForLongTime (string $name, ?string $value=null)
 Create a new cookie with the given name and value which expires in 5 years.
Parameters
string$nameThe unique cookie name.
null | string$valueCookie value.
More...
 
 createExpired (string $name)
 Creates an already expired cookie.This is useful if the cookie should be deleted at the client end.
Parameters
string$nameCookie name.
More...
 
 fromSetCookieString (string $string)
 Creates the cookie from the cookie string.
Parameters
string$stringCookie string.
More...
 

Detailed Description

Definition at line 33 of file CookieFactoryImpl.php.

Member Function Documentation

◆ create()

ILIAS\HTTP\Cookies\CookieFactoryImpl::create ( string  $name,
?string  $value = null 
)

Create a new cookie with the given name and value.

Parameters
string$nameThe unique cookie name.
null | string$valueCookie value.

Implements ILIAS\HTTP\Cookies\CookieFactory.

Definition at line 38 of file CookieFactoryImpl.php.

38  : Cookie
39  {
40  return new CookieWrapper(SetCookie::create($name, $value));
41  }

◆ createExpired()

ILIAS\HTTP\Cookies\CookieFactoryImpl::createExpired ( string  $name)

Creates an already expired cookie.This is useful if the cookie should be deleted at the client end.

Parameters
string$nameCookie name.

Implements ILIAS\HTTP\Cookies\CookieFactory.

Definition at line 56 of file CookieFactoryImpl.php.

56  : Cookie
57  {
58  return new CookieWrapper(SetCookie::createExpired($name));
59  }

◆ createRememberedForLongTime()

ILIAS\HTTP\Cookies\CookieFactoryImpl::createRememberedForLongTime ( string  $name,
?string  $value = null 
)

Create a new cookie with the given name and value which expires in 5 years.

Parameters
string$nameThe unique cookie name.
null | string$valueCookie value.

Implements ILIAS\HTTP\Cookies\CookieFactory.

Definition at line 47 of file CookieFactoryImpl.php.

47  : Cookie
48  {
49  return new CookieWrapper(SetCookie::createRememberedForever($name, $value));
50  }

◆ fromSetCookieString()

ILIAS\HTTP\Cookies\CookieFactoryImpl::fromSetCookieString ( string  $string)

Creates the cookie from the cookie string.

Parameters
string$stringCookie string.

Implements ILIAS\HTTP\Cookies\CookieFactory.

Definition at line 65 of file CookieFactoryImpl.php.

65  : Cookie
66  {
67  return new CookieWrapper(SetCookie::fromSetCookieString($string));
68  }

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