public void Append(string key, string value, CookieOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } var issueCookie = CanTrack || options.IsEssential; ApplyPolicy(options); if (Options.OnAppendCookie != null) { var context = new AppendCookieContext(Context, options, key, value) { IsConsentNeeded = IsConsentNeeded, HasConsent = HasConsent, IssueCookie = issueCookie, }; Options.OnAppendCookie(context); key = context.CookieName; value = context.CookieValue; issueCookie = context.IssueCookie; } if (issueCookie) { Cookies.Append(key, value, options); } }
public void Append(string key, string value, CookieOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } ApplyPolicy(options); if (Policy.OnAppendCookie != null) { var context = new AppendCookieContext(Context, options, key, value); Policy.OnAppendCookie(context); key = context.CookieName; value = context.CookieValue; } Cookies.Append(key, value, options); }
private bool ApplyAppendPolicy(ref string key, ref string value, CookieOptions options) { var issueCookie = CanTrack || options.IsEssential; ApplyPolicy(key, options); if (Options.OnAppendCookie != null) { var context = new AppendCookieContext(Context, options, key, value) { IsConsentNeeded = IsConsentNeeded, HasConsent = HasConsent, IssueCookie = issueCookie, }; Options.OnAppendCookie(context); key = context.CookieName; value = context.CookieValue; issueCookie = context.IssueCookie; } return(issueCookie); }
public void Append(string key, string value, CookieOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } ApplyPolicy(options); if (Policy.OnAppendCookie != null) { var context = new AppendCookieContext(Context, options, key, value); Policy.OnAppendCookie(context); key = context.CookieName; value = context.CookieValue; } Cookies.Append(key, value, options); }