protected Tuple <CustomerSource, string> GetSource() { try { var cookie = Request.Cookies[SOURCE_COOKIE_NAME]; if (cookie == null) { return(Tuple.Create(DbSession.Get <CustomerSource>(1), String.Empty)); } var sourceInfo = SourceInfo.Decode(cookie.Value); if (sourceInfo == null) { return(Tuple.Create(DbSession.Get <CustomerSource>(1), String.Empty)); } return(Tuple.Create(DbSession.Get <CustomerSource>(sourceInfo.Src), sourceInfo.Sub)); } catch { return(Tuple.Create(DbSession.Get <CustomerSource>(1), String.Empty)); } }