mirror of
https://github.com/nextcloud/server.git
synced 2026-02-21 00:45:24 -05:00
Currently there is no AppFramework way to modify cookies, which makes it unusable for quite some use-cases or results in untestable code.
This PR adds some basic functionalities to add and invalidate cookies.
Usage:
```php
$response = new TemplateResponse(...);
$response->addCookie('foo', 'bar');
$response->invalidateCookie('foo');
$response->addCookie('bar', 'foo', new \DateTime('2015-01-01 00:00'));
```
Existing cookies can be accessed with the AppFramework using `$this->request->getCookie($name)`.
|
||
|---|---|---|
| .. | ||
| DataResponseTest.php | ||
| DispatcherTest.php | ||
| DownloadResponseTest.php | ||
| HttpTest.php | ||
| JSONResponseTest.php | ||
| RedirectResponseTest.php | ||
| requeststream.php | ||
| RequestTest.php | ||
| ResponseTest.php | ||
| TemplateResponseTest.php | ||