You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e3a19c3
Browse filesBrowse the repository at this point in the historyBrowse files
// Returns true when cookie was found, false when no cookie was found...
62
-
$.removeCookie('the_cookie');
63
-
64
-
// Same path as when the cookie was written...
65
-
$.removeCookie('the_cookie', { path:'/' });
61
+
// Returns true when cookie was successfully deleted, otherwise false
62
+
$.removeCookie('name'); // => true
63
+
$.removeCookie('nothing'); // => false
64
+
65
+
// Need to use the same attributes (path, domain) as what the cookie was written with
66
+
$.cookie('name', 'value', { path:'/' });
67
+
// This won't work!
68
+
$.removeCookie('name'); // => false
69
+
// This will work!
70
+
$.removeCookie('name', { path:'/' }); // => true
66
71
```
67
72
68
73
*Note: when deleting a cookie, you must pass the exact same path, domain and secure options that were used to set the cookie, unless you're relying on the default options that is.*
0 commit comments