ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CookieFactoryImpl.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\HTTP\Cookies;
20
21use Dflydev\FigCookies\SetCookie;
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}
create(string $name, ?string $value=null)
Create a new cookie with the given name and value.
createExpired(string $name)
Creates an already expired cookie.This is useful if the cookie should be deleted at the client end.
fromSetCookieString(string $string)
Creates the cookie from the cookie string.
createRememberedForLongTime(string $name, ?string $value=null)
Create a new cookie with the given name and value which expires in 5 years.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Cookie.php:19