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
$.cookie('the_cookie', {raw: true}); // => 'the_value' NOT URL decoded
27
+
$.cookie('the_cookie'); // => "the_value"
28
+
$.cookie('the_cookie', {raw: true}); // => "the_value" not URL decoded
29
29
$.cookie('not_existing'); // => null
30
30
31
31
Delete cookie by passing null as value:
32
32
33
33
$.cookie('the_cookie', null);
34
34
35
-
*Note: when deleting a cookie, you must pass the exact same path, domain and secure options that were used to set the cookie.*
35
+
*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.*
36
36
37
37
## Options
38
38
39
39
Options can be set globally by setting properties of the `$.cookie.defaults` object or individually for each call to `$.cookie()` by passing a plain object to the options argument. Per-call options override the ones set by `$.cookie.defaults`.
40
40
41
41
expires: 365
42
42
43
-
Define lifetime of the cookie. Value can be a `Number`(which will be interpreted as days from time of creation) or a `Date` object. If omitted, the cookie becomes a session cookie.
43
+
Define lifetime of the cookie. Value can be a `Number` which will be interpreted as days from time of creation or a `Date` object. If omitted, the cookie becomes a session cookie.
44
44
45
45
path: '/'
46
46
@@ -56,7 +56,7 @@ If true, the cookie transmission requires a secure protocol (https). Default: `f
56
56
57
57
raw: true
58
58
59
-
By default the cookie is encoded/decoded when creating/reading, using `encodeURIComponent`/`decodeURIComponent`. Turn off by setting `raw: true`. Default: `false`.
59
+
By default the cookie value is encoded/decoded when creating/reading, using `encodeURIComponent`/`decodeURIComponent`. Turn off by setting `raw: true`. Default: `false`.
0 commit comments