diff --git a/src/Pluf/HTTP/Response.php b/src/Pluf/HTTP/Response.php index 850703c..0b5dfdb 100644 --- a/src/Pluf/HTTP/Response.php +++ b/src/Pluf/HTTP/Response.php @@ -156,8 +156,9 @@ class Pluf_HTTP_Response } foreach ($this->cookies as $cookie => $data) { // name, data, expiration, path, domain, secure, http only - setcookie($cookie, $data, - time()+31536000, + $expire = (null == $data) ? time()-31536000 : time()+31536000; + $data = (null == $data) ? '' : $data; + setcookie($cookie, $data, $expire, Pluf::f('cookie_path', '/'), Pluf::f('cookie_domain', null), Pluf::f('cookie_secure', false), diff --git a/src/Pluf/Middleware/Session.php b/src/Pluf/Middleware/Session.php index 8d3fb54..c0337c7 100644 --- a/src/Pluf/Middleware/Session.php +++ b/src/Pluf/Middleware/Session.php @@ -128,7 +128,7 @@ class Pluf_Middleware_Session $data['Pluf_Session_key'] = $request->session->session_key; $response->cookies[$request->session->cookie_name] = self::_encodeData($data); } - if ($request->session->set_test_cookie != null) { + if ($request->session->set_test_cookie != false) { $response->cookies[$request->session->test_cookie_name] = $request->session->test_cookie_value; } return $response; diff --git a/src/Pluf/Session.php b/src/Pluf/Session.php index d2e5385..8ff1bac 100644 --- a/src/Pluf/Session.php +++ b/src/Pluf/Session.php @@ -160,6 +160,7 @@ class Pluf_Session extends Pluf_Model public function deleteTestCookie() { - $this->set_test_cookie = false; + $this->set_test_cookie = true; + $this->test_cookie_value = null; } }