From 8fbbd3d8a094ee4e4659c3b6d342e080a029c6c7 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 15 Aug 2013 17:14:05 +1000 Subject: [PATCH] Fixes issue with invalid cookie --- src/Umbraco.Web/UmbracoModule.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index f24c0199ba..4d568f1b6b 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -6,6 +6,7 @@ using System.Security.Principal; using System.Threading; using System.Web; using System.Web.Routing; +using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Logging; @@ -194,10 +195,18 @@ namespace Umbraco.Web Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(identity.Culture); } - catch (FormatException) + catch (Exception ex) { - //this will occur if the cookie data is invalid - http.UmbracoLogout(); + if (ex is FormatException || ex is JsonReaderException) + { + //this will occur if the cookie data is invalid + http.UmbracoLogout(); + } + else + { + throw; + } + } } }