private void SetCookieValue(LocalizationCookie cookie) { var response = m_httpContextAccessor.HttpContext.Response; var serializedCookie = CookieSerializer.Serialize(cookie); response.Cookies.Append( CultureCookieName, serializedCookie, new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1), IsEssential = true, Secure = m_configuration.SecureCookie, } ); }
public static string Serialize(LocalizationCookie cookie) { return(JsonConvert.SerializeObject(cookie)); }