diff --git a/CookieMonster.js b/CookieMonster.js index 289ee6a..80554b2 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -687,6 +687,10 @@ CM.Config.SaveConfig = function(config) { * It is called by CM.DelayInit() and CM.Config.RestoreDefault() */ CM.Config.LoadConfig = function(settings) { + // This removes cookies left from earlier versions of CookieMonster + if (typeof localStorage.CMConfig != "undefined") { + delete localStorage.CMConfig; + } if (settings != null) { CM.Options = settings; diff --git a/src/Config.js b/src/Config.js index 066b88d..dd86c78 100644 --- a/src/Config.js +++ b/src/Config.js @@ -22,6 +22,10 @@ CM.Config.SaveConfig = function(config) { * It is called by CM.DelayInit() and CM.Config.RestoreDefault() */ CM.Config.LoadConfig = function(settings) { + // This removes cookies left from earlier versions of CookieMonster + if (typeof localStorage.CMConfig != "undefined") { + delete localStorage.CMConfig; + } if (settings != null) { CM.Options = settings;