Fixed a bug with the client settings cookie pathing in IE

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-25 22:54:15 -07:00
parent e8bd79e485
commit a5cc6921d5

View File

@@ -4,7 +4,22 @@
orchard: {
__cookieName: "Orchrd", // Orchard, on a diet
__cookieExpiration: 180, // roughly 6 months
___doCookiePathHack: null,
__doCookiePathHack: function (path) {
if ($.orchard.___doCookiePathHack != null) {
return $.orchard.___doCookiePathHack;
}
var testCookie = "__orchard__";
$.cookie(testCookie, "1", { path: path });
$.orchard.___doCookiePathHack = !$.cookie(testCookie);
$.cookie(testCookie, null);
return $.orchard.___doCookiePathHack;
},
cookie: function (scope, value, options) { // a light-weight wrapper around $.cookie for an Orchard.* cookie name
// because some browsers are weird about the path
if (options && options.path && $.orchard.__doCookiePathHack(options.path)) {
options.path = options.path.substring(0, options.path.lastIndexOf("/"));
}
return $.cookie($.orchard.__cookieName + (scope ? scope.toLowerCase() : ""), value, options);
},
cookiesInTheOrchard: function () {