public void SetAuthenticationInfo(AuthenticationInfo authenticationInfo) { string userData = JsonConvert.SerializeObject(authenticationInfo); var formsAuthenticationTicket = new FormsAuthenticationTicket(1, authenticationInfo.UserAlias, DateTime.Now, DateTime.Now.AddHours(1), false, userData); string encryptedCookie = FormsAuthentication.Encrypt(formsAuthenticationTicket); var httpCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedCookie); _httpContextProvider.AddCookie(httpCookie); }