Browse files

Update docs for CookieComponent::delete().

Refs #2182
  • Loading branch information...
1 parent 07f4779 commit a7537183875c09632590b3256894b82e49919f39 @markstory markstory committed Oct 29, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Cake/Controller/Component/CookieComponent.php
View
8 lib/Cake/Controller/Component/CookieComponent.php
@@ -307,11 +307,17 @@ public function check($key = null) {
* Delete a cookie value
*
* Optional [Name.], required key
- * $this->Cookie->read('Name.key);
+ * $this->Cookie->delete('Name.key);
*
* You must use this method before any output is sent to the browser.
* Failure to do so will result in header already sent errors.
*
+ * This method will delete both the top level and 2nd level cookies set.
+ * For example assuming that $name = App, deleting `User` will delete
+ * both `App[User]` and any other cookie values like `App[User][email]`
+ * This is done to clean up cookie storage from before 2.4.3, where cookies
+ * were stored inconsistently.
+ *
* @param string $key Key of the value to be deleted
* @return void
* @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html#CookieComponent::delete

0 comments on commit a753718

Please sign in to comment.