ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
CookieFactoryImpl.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\HTTP\Cookies;
20 
22 
34 {
38  public function create(string $name, ?string $value = null): Cookie
39  {
40  return new CookieWrapper(SetCookie::create($name, $value));
41  }
42 
43 
47  public function createRememberedForLongTime(string $name, ?string $value = null): Cookie
48  {
49  return new CookieWrapper(SetCookie::createRememberedForever($name, $value));
50  }
51 
52 
56  public function createExpired(string $name): Cookie
57  {
58  return new CookieWrapper(SetCookie::createExpired($name));
59  }
60 
61 
65  public function fromSetCookieString(string $string): Cookie
66  {
67  return new CookieWrapper(SetCookie::fromSetCookieString($string));
68  }
69 }
fromSetCookieString(string $string)
Creates the cookie from the cookie string.Cookie string.
create(string $name, ?string $value=null)
Create a new cookie with the given name and value.The unique cookie name. Cookie value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Cookie.php:19
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
createRememberedForLongTime(string $name, ?string $value=null)
Create a new cookie with the given name and value which expires in 5 years.The unique cookie name...
createExpired(string $name)
Creates an already expired cookie.This is useful if the cookie should be deleted at the client end...