ILIAS  release_7 Revision v7.30-3-g800a261c036
CookieFactoryImpl.php
Go to the documentation of this file.
1<?php
2
3namespace ILIAS\HTTP\Cookies;
4
5use Dflydev\FigCookies\SetCookie;
6
18{
19
23 public function create(string $name, string $value = null) : \ILIAS\HTTP\Cookies\Cookie
24 {
25 return new CookieWrapper(SetCookie::create($name, $value));
26 }
27
28
32 public function createRememberedForLongTime(string $name, string $value = null) : \ILIAS\HTTP\Cookies\Cookie
33 {
34 return new CookieWrapper(SetCookie::createRememberedForever($name, $value));
35 }
36
37
41 public function createExpired(string $name) : \ILIAS\HTTP\Cookies\Cookie
42 {
43 return new CookieWrapper(SetCookie::createExpired($name));
44 }
45
46
50 public function fromSetCookieString(string $string) : \ILIAS\HTTP\Cookies\Cookie
51 {
52 return new CookieWrapper(SetCookie::fromSetCookieString($string));
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
createRememberedForLongTime(string $name, string $value=null)
Create a new cookie with the given name and value which expires in 5 years.Cookie
createExpired(string $name)
Creates an already expired cookie.This is useful if the cookie should be deleted at the client end....
create(string $name, string $value=null)
Create a new cookie with the given name and value.Cookie
fromSetCookieString(string $string)
Creates the cookie from the cookie string.Cookie
if($format !==null) $name
Definition: metadata.php:230
Class CookieJarWrapperTest.
Definition: Cookie.php:3
Class ChatMainBarProvider \MainMenu\Provider.