public T Get <T>(string name) { try { var cookieString = _encodeCookie ? _cookieHelper.GetProtect(name) : _cookieHelper.Get(name); if (string.IsNullOrEmpty(cookieString)) { return(default(T)); } var obj = JsonConvert.DeserializeObject <T>(cookieString); return(obj); } catch { return(default(T)); } }