Skip to content

Commit 66412a2

Browse files
committed
expose default options as $.cookie.defaults
allows setting options globally for all calls to $.cookie()
1 parent 1fa4a18 commit 66412a2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎jquery.cookie.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// key and at least value given, set cookie...
1414
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
15-
options = $.extend({}, options);
15+
options = $.extend({}, $.cookie.defaults || {}, options);
1616

1717
if (value === null || value === undefined) {
1818
options.expires = -1;
@@ -35,7 +35,7 @@
3535
}
3636

3737
// key and possibly options given, get cookie...
38-
options = value || {};
38+
options = value || $.cookie.defaults || {};
3939
var decode = options.raw ? function(s) { return s; } : decodeURIComponent;
4040

4141
var pairs = document.cookie.split('; ');

0 commit comments

Comments
 (0)