From abad63d9fc9c8c6eda9f687b196412b49d3cc4c8 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 28 Sep 2010 18:17:21 +0200 Subject: [PATCH] fixed path for cookie --- backend/lib/Controller/EntityController.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/lib/Controller/EntityController.php b/backend/lib/Controller/EntityController.php index 360ae44..62567cf 100644 --- a/backend/lib/Controller/EntityController.php +++ b/backend/lib/Controller/EntityController.php @@ -81,6 +81,10 @@ class EntityController extends Controller { return $entity; } + /** + * Adds an entity to the uuids cookie + * @param Model\Entity $entity + */ protected function setCookie(Model\Entity $entity) { if ($uuids = $this->view->request->getParameter('uuids', 'cookies')) { $uuids = Util\JSON::decode($uuids); @@ -96,9 +100,13 @@ class EntityController extends Controller { $uuids->exchangeArray(array_unique($uuids->getArrayCopy())); // send new cookie to browser - setcookie('uuids', $uuids->encode()); + setcookie('uuids', $uuids->encode(), 0, '/'); // TODO corrent path } + /** + * Removes an entity from the uuids cookie + * @param Model\Entity $entity + */ protected function unsetCookie(Model\Entity $entity) { if ($uuids = $this->view->request->getParameter('uuids', 'cookies')) { $uuids = Util\JSON::decode($uuids); @@ -113,7 +121,7 @@ class EntityController extends Controller { })); // send new cookie to browser - setcookie('uuids', $uuids->encode()); + setcookie('uuids', $uuids->encode(), 0, '/'); // TODO correct path } protected function setProperties(Model\Entity $entity) {