1 | <?php |
||
28 | final class CookieHelper |
||
29 | { |
||
30 | /** |
||
31 | * @var Cookie |
||
32 | */ |
||
33 | private $cookie; |
||
34 | |||
35 | public function __construct(Cookie $cookie) |
||
39 | |||
40 | /** |
||
41 | * Write a new value for the current cookie to a given Response. |
||
42 | * |
||
43 | * @param string $value |
||
44 | * @return Cookie |
||
45 | */ |
||
46 | public function write(Response $response, $value) |
||
52 | |||
53 | /** |
||
54 | * Retrieve the current cookie from the Request if it exists. |
||
55 | * |
||
56 | * Note that we only read the value, we ignore the other settings. |
||
57 | * |
||
58 | * @param Request $request |
||
59 | * @return null|Cookie |
||
60 | */ |
||
61 | public function read(Request $request) |
||
71 | |||
72 | /** |
||
73 | * Create a new cookie from the current (template) cookie with a new value. |
||
74 | * |
||
75 | * @param $value |
||
76 | * @return Cookie |
||
77 | */ |
||
78 | private function createCookieWithValue($value) |
||
90 | } |
||
91 |