ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
CookieFactoryImpl.php
Go to the documentation of this file.
1 <?php
2 
3 namespace ILIAS\HTTP\Cookies;
4 
6 
7 /******************************************************************************
8  *
9  * This file is part of ILIAS, a powerful learning management system.
10  *
11  * ILIAS is licensed with the GPL-3.0, you should have received a copy
12  * of said license along with the source code.
13  *
14  * If this is not the case or you just want to try ILIAS, you'll find
15  * us at:
16  * https://www.ilias.de
17  * https://github.com/ILIAS-eLearning
18  *
19  *****************************************************************************/
31 {
35  public function create(string $name, string $value = null): Cookie
36  {
37  return new CookieWrapper(SetCookie::create($name, $value));
38  }
39 
40 
44  public function createRememberedForLongTime(string $name, string $value = null): Cookie
45  {
46  return new CookieWrapper(SetCookie::createRememberedForever($name, $value));
47  }
48 
49 
53  public function createExpired(string $name): Cookie
54  {
55  return new CookieWrapper(SetCookie::createExpired($name));
56  }
57 
58 
62  public function fromSetCookieString(string $string): Cookie
63  {
64  return new CookieWrapper(SetCookie::fromSetCookieString($string));
65  }
66 }
create(string $name, string $value=null)
Create a new cookie with the given name and value.The unique cookie name. Cookie value.
fromSetCookieString(string $string)
Creates the cookie from the cookie string.Cookie string.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Cookie.php:19
if($format !==null) $name
Definition: metadata.php:247
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...