mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixed a bug with the client settings cookie pathing in IE
--HG-- branch : dev
This commit is contained in:
@@ -4,7 +4,22 @@
|
|||||||
orchard: {
|
orchard: {
|
||||||
__cookieName: "Orchrd", // Orchard, on a diet
|
__cookieName: "Orchrd", // Orchard, on a diet
|
||||||
__cookieExpiration: 180, // roughly 6 months
|
__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
|
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);
|
return $.cookie($.orchard.__cookieName + (scope ? scope.toLowerCase() : ""), value, options);
|
||||||
},
|
},
|
||||||
cookiesInTheOrchard: function () {
|
cookiesInTheOrchard: function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user