63 instantiations of CookieOptions
CookiePolicySample (1)
Startup.cs (1)
58new CookieOptions() { IsEssential = true });
HttpAbstractions.SampleApp (1)
Program.cs (1)
43response.Cookies.Append("Cookie1", "value1", new CookieOptions() { Expires = DateTimeOffset.UtcNow + TimeSpan.FromDays(1) });
Microsoft.AspNetCore.Authentication.Cookies (2)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (2)
304responseCookies.Append(keyValuePairs, new CookieOptions(options) 332context.Response.Cookies.Append(keyValuePairs.ToArray(), new CookieOptions(options)
Microsoft.AspNetCore.CookiePolicy (2)
ResponseCookiesWrapper.cs (2)
116Append(key, value, new CookieOptions()); 188Delete(key, new CookieOptions());
Microsoft.AspNetCore.CookiePolicy.Test (35)
CookieChunkingTests.cs (10)
17new ChunkingCookieManager() { ChunkSize = null }.AppendResponseCookie(context, "TestCookie", testString, new CookieOptions()); 28var options = new CookieOptions 52new ChunkingCookieManager() { ChunkSize = 44 }.AppendResponseCookie(context, "TestCookie", testString, new CookieOptions()); 71new CookieOptions() { Extensions = { "simple", "key=value" } }); 99new ChunkingCookieManager() { ChunkSize = 31 }.AppendResponseCookie(context, "TestCookie", "ShortValue", new CookieOptions()); 130new ChunkingCookieManager() { ChunkSize = 31 }.AppendResponseCookie(context, "TestCookie", "abcdefghijklmnopqr", new CookieOptions()); 213new ChunkingCookieManager().DeleteCookie(context, "TestCookie", new CookieOptions() { Domain = "foo.com", Secure = true, Extensions = { "extension" } }); 235new ChunkingCookieManager().DeleteCookie(context, "TestCookie", new CookieOptions() { Domain = "foo.com", Secure = true }); 253new ChunkingCookieManager().DeleteCookie(context, "TestCookie", new CookieOptions() { Domain = "foo.com", Secure = true }); 282var cookieOptions = new CookieOptions()
CookieConsentTests.cs (4)
65context.Response.Cookies.Append("Test", "Value", new CookieOptions() { IsEssential = false }); 91context.Response.Cookies.Append("Test", "Value", new CookieOptions() { IsEssential = false }); 110context.Response.Cookies.Append("Test", "Value", new CookieOptions() { IsEssential = true }); 140context.Response.Cookies.Append("Test", "Value", new CookieOptions() { IsEssential = true });
CookiePolicyTests.cs (19)
24context.Response.Cookies.Append("B", "B", new CookieOptions { Secure = false }); 25context.Response.Cookies.Append("C", "C", new CookieOptions()); 26context.Response.Cookies.Append("D", "D", new CookieOptions { Secure = true }); 32context.Response.Cookies.Append("B", "B", new CookieOptions { HttpOnly = false }); 33context.Response.Cookies.Append("C", "C", new CookieOptions()); 34context.Response.Cookies.Append("D", "D", new CookieOptions { HttpOnly = true }); 40context.Response.Cookies.Append("B", "B", new CookieOptions()); 41context.Response.Cookies.Append("C", "C", new CookieOptions { SameSite = Http.SameSiteMode.None }); 42context.Response.Cookies.Append("D", "D", new CookieOptions { SameSite = Http.SameSiteMode.Lax }); 43context.Response.Cookies.Append("E", "E", new CookieOptions { SameSite = Http.SameSiteMode.Strict }); 44context.Response.Cookies.Append("F", "F", new CookieOptions { SameSite = (Http.SameSiteMode)(-1) }); 258context.Response.Cookies.Append("B", "B", new CookieOptions { Secure = false }); 259context.Response.Cookies.Append("C", "C", new CookieOptions() { SameSite = Http.SameSiteMode.Strict }); 260context.Response.Cookies.Append("D", "D", new CookieOptions { Secure = true }); 297context.Response.Cookies.Delete("B", new CookieOptions { Secure = false }); 298context.Response.Cookies.Delete("C", new CookieOptions()); 299context.Response.Cookies.Delete("D", new CookieOptions { Secure = true }); 339Assert.Throws<NotImplementedException>(() => context.Response.Cookies.Delete("A", new CookieOptions())); 341Assert.Throws<NotImplementedException>(() => context.Response.Cookies.Append("A", "A", new CookieOptions()));
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (2)
304responseCookies.Append(keyValuePairs, new CookieOptions(options) 332context.Response.Cookies.Append(keyValuePairs.ToArray(), new CookieOptions(options)
Microsoft.AspNetCore.Http (2)
Internal\ResponseCookies.cs (2)
108Delete(key, new CookieOptions() { Path = "/" }); 163Append(key, string.Empty, new CookieOptions(options)
Microsoft.AspNetCore.Http.Abstractions (1)
CookieBuilder.cs (1)
109var options = new CookieOptions
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
CookieBuilderTests.cs (1)
51Assert.Equal(new CookieOptions().Path, new CookieBuilder().Build(new DefaultHttpContext()).Path);
Microsoft.AspNetCore.Http.Tests (10)
CookieOptionsTests.cs (2)
18var original = new CookieOptions() 30var copy = new CookieOptions(original);
ResponseCookiesTest.cs (8)
41cookies.Append(testCookie, "value", new CookieOptions() 65cookies.Append(testCookie, "value", new CookieOptions() 86cookies.Delete(testCookie, new CookieOptions() 134responseCookies.Delete(cookie.Key, new CookieOptions() { Domain = cookie.Domain, Path = cookie.Path }); 164responseCookies.Append(cookie.Key, cookie.Key, new CookieOptions() { Domain = cookie.Domain, Path = cookie.Path }); 165responseCookies.Delete(cookie.Key, new CookieOptions() { Domain = cookie.Domain, Path = cookie.Path }); 183var options = new CookieOptions 231var cookieOptions = new CookieOptions();
Microsoft.AspNetCore.Mvc.Core (2)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (2)
304responseCookies.Append(keyValuePairs, new CookieOptions(options) 332context.Response.Cookies.Append(keyValuePairs.ToArray(), new CookieOptions(options)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
CookieTempDataProviderTest.cs (1)
365Append(key, value, new CookieOptions());
Microsoft.AspNetCore.Rewrite (2)
UrlActions\ChangeCookieAction.cs (2)
46return new CookieOptions() 58_cachedOptions = new CookieOptions()
Microsoft.AspNetCore.Security.Microbenchmarks (1)
ChunkingCookieManagerBenchmark.cs (1)
29_cookieOptions = new CookieOptions()
SignalR.Client.FunctionalTestApp (2)
Startup.cs (2)
181var cookieOptions = new CookieOptions(); 182var expiredCookieOptions = new CookieOptions() { Expires = DateTimeOffset.Now.AddHours(-1) };
113 references to CookieOptions
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgeryTokenStore.cs (1)
84var options = _options.Cookie.Build(httpContext);
Microsoft.AspNetCore.Antiforgery.Test (3)
DefaultAntiforgeryTokenStoreTest.cs (3)
530public CookieOptions? Options { get; set; } 533public void Append(string key, string value, CookieOptions options) 546public void Delete(string key, CookieOptions options)
Microsoft.AspNetCore.Authentication (8)
RemoteAuthenticationHandler.cs (2)
234var cookieOptions = Options.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow()); 269var cookieOptions = Options.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow());
RemoteAuthenticationOptions.cs (2)
169public override CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom) 171var cookieOptions = base.Build(context, expiresFrom);
RequestPathBaseCookieBuilder.cs (4)
9/// A cookie builder that sets <see cref="CookieOptions.Path"/> to the request path base. 19/// Configures <see cref="CookieOptions.Path"/> if not explicitly configured. 22public override CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom) 32var options = base.Build(context, expiresFrom);
Microsoft.AspNetCore.Authentication.Cookies (15)
CookieAuthenticationHandler.cs (5)
229private CookieOptions BuildCookieOptions() 231var cookieOptions = Options.Cookie.Build(Context); 274var cookieOptions = BuildCookieOptions(); 301var cookieOptions = BuildCookieOptions(); 389var cookieOptions = BuildCookieOptions();
CookieAuthenticationOptions.cs (1)
131/// This is separate from the value of <see cref="CookieOptions.Expires"/>, which specifies
CookieSigningInContext.cs (2)
29CookieOptions cookieOptions) 40public CookieOptions CookieOptions { get; set; }
CookieSigningOutContext.cs (2)
26CookieOptions cookieOptions) 34public CookieOptions CookieOptions { get; set; }
ICookieManager.cs (2)
29void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options); 37void DeleteCookie(HttpContext context, string key, CookieOptions options);
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (3)
145public void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options) 224public void DeleteCookie(HttpContext context, string key, CookieOptions options) 312private static void DeleteChunks(HttpContext context, IRequestCookieCollection requestCookies, CookieOptions options, string key, int startChunk, int endChunk)
Microsoft.AspNetCore.Authentication.OpenIdConnect (4)
OpenIdConnectHandler.cs (2)
1162var cookieOptions = Options.NonceCookie.Build(Context, TimeProvider.GetUtcNow()); 1193var cookieOptions = Options.NonceCookie.Build(Context, TimeProvider.GetUtcNow());
OpenIdConnectOptions.cs (2)
352public override CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom) 354var cookieOptions = base.Build(context, expiresFrom);
Microsoft.AspNetCore.Authentication.Twitter (4)
TwitterHandler.cs (2)
101var cookieOptions = Options.StateCookie.Build(Context, TimeProvider.GetUtcNow()); 175var cookieOptions = Options.StateCookie.Build(Context, TimeProvider.GetUtcNow());
TwitterOptions.cs (2)
120public override CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom) 122var options = base.Build(context, expiresFrom);
Microsoft.AspNetCore.CookiePolicy (20)
AppendCookieContext.cs (4)
18/// <param name="options">The <see cref="Http.CookieOptions"/> passed to the cookie policy.</param> 21public AppendCookieContext(HttpContext context, CookieOptions options, string name, string value) 35/// Gets the <see cref="Http.CookieOptions"/>. 37public CookieOptions CookieOptions { get; }
CookiePolicyMiddleware.cs (4)
17/// When using <see cref="CookieOptions"/> to configure cookies, note that a 18/// <see cref="CookieOptions"/> instance is intended to govern the behavior of an individual cookie. 19/// Reusing the same <see cref="CookieOptions"/> instance across multiple cookies can lead to unintended 21/// <see cref="CookieOptions"/> object for each cookie to ensure that the configuration is applied
DeleteCookieContext.cs (4)
18/// <param name="options">The <see cref="Http.CookieOptions"/> passed to the cookie policy.</param> 20public DeleteCookieContext(HttpContext context, CookieOptions options, string name) 33/// Gets the <see cref="Http.CookieOptions"/>. 35public CookieOptions CookieOptions { get; }
ResponseCookiesWrapper.cs (8)
71var cookieOptions = Options.ConsentCookie.Build(Context); 83var cookieOptions = Options.ConsentCookie.Build(Context); 96var options = Options.ConsentCookie.Build(Context); 124public void Append(string key, string value, CookieOptions options) 138public void Append(ReadOnlySpan<KeyValuePair<string, string>> keyValuePairs, CookieOptions options) 162private bool ApplyAppendPolicy(ref string key, ref string value, CookieOptions options) 196public void Delete(string key, CookieOptions options) 227private void ApplyPolicy(string key, CookieOptions options)
Microsoft.AspNetCore.CookiePolicy.Test (7)
CookieChunkingTests.cs (2)
28var options = new CookieOptions 282var cookieOptions = new CookieOptions()
CookiePolicyTests.cs (2)
486public void Append(string key, string value, CookieOptions options) 496public void Delete(string key, CookieOptions options)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (3)
145public void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options) 224public void DeleteCookie(HttpContext context, string key, CookieOptions options) 312private static void DeleteChunks(HttpContext context, IRequestCookieCollection requestCookies, CookieOptions options, string key, int startChunk, int endChunk)
Microsoft.AspNetCore.Http (4)
Internal\ResponseCookies.cs (4)
44public void Append(string key, string value, CookieOptions options) 68public void Append(ReadOnlySpan<KeyValuePair<string, string>> keyValuePairs, CookieOptions options) 112public void Delete(string key, CookieOptions options) 120Func<string, string, CookieOptions, bool> rejectPredicate;
Microsoft.AspNetCore.Http.Abstractions (9)
CookieBuilder.cs (9)
31/// Determines the value that will be set for <see cref="CookieOptions.Path"/>. 39/// Determines the value that will be set for <see cref="CookieOptions.Domain"/>. 48/// Determines the value that will be set on <see cref="CookieOptions.HttpOnly"/>. 57/// Determines the value that will be set for <see cref="CookieOptions.SameSite"/>. 62/// The policy that will be used to determine <see cref="CookieOptions.Secure"/>. 97public CookieOptions Build(HttpContext context) => Build(context, DateTimeOffset.Now); 103/// <param name="expiresFrom">The time to use as the base for computing <see cref="CookieOptions.Expires" />.</param> 105public virtual CookieOptions Build(HttpContext context, DateTimeOffset expiresFrom) 109var options = new CookieOptions
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
CookieBuilderTests.cs (4)
23var options = builder.Build(context); 34var options = new CookieBuilder { Expiration = TimeSpan.FromHours(1) }.Build(new DefaultHttpContext(), now); 44var options = new CookieBuilder { MaxAge = now }.Build(new DefaultHttpContext()); 61var options = builder.Build(new DefaultHttpContext());
Microsoft.AspNetCore.Http.Features (13)
CookieOptions.cs (5)
12/// A <see cref="CookieOptions"/> instance is intended to govern the behavior of an individual cookie. 13/// Reusing the same <see cref="CookieOptions"/> instance across multiple cookies can lead to unintended 15/// <see cref="CookieOptions"/> object for each cookie to ensure that the configuration is applied 31/// Creates a copy of the given <see cref="CookieOptions"/>. 33public CookieOptions(CookieOptions options)
IResponseCookies.cs (8)
23/// <param name="options"><see cref="CookieOptions"/> included in the new cookie setting.</param> 24void Append(string key, string value, CookieOptions options); 30/// <param name="options"><see cref="CookieOptions"/> included in new cookie settings.</param> 31void Append(ReadOnlySpan<KeyValuePair<string, string>> keyValuePairs, CookieOptions options) 50/// <see cref="CookieOptions"/> used to discriminate the particular cookie to expire. The 51/// <see cref="CookieOptions.Domain"/> and <see cref="CookieOptions.Path"/> values are especially important. 53void Delete(string key, CookieOptions options);
Microsoft.AspNetCore.Http.Tests (5)
CookieOptionsTests.cs (3)
18var original = new CookieOptions() 30var copy = new CookieOptions(original); 32var properties = typeof(CookieOptions).GetProperties(BindingFlags.Public | BindingFlags.Instance);
ResponseCookiesTest.cs (2)
183var options = new CookieOptions 231var cookieOptions = new CookieOptions();
Microsoft.AspNetCore.Mvc.Core (3)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (3)
145public void AppendResponseCookie(HttpContext context, string key, string? value, CookieOptions options) 224public void DeleteCookie(HttpContext context, string key, CookieOptions options) 312private static void DeleteChunks(HttpContext context, IRequestCookieCollection requestCookies, CookieOptions options, string key, int startChunk, int endChunk)
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
CookieTempDataProvider.cs (2)
106var cookieOptions = _options.Cookie.Build(context); 123private void SetCookiePath(HttpContext httpContext, CookieOptions cookieOptions)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (3)
CookieTempDataProviderTest.cs (3)
353public void Append(string key, string value, CookieOptions options) 368public void Delete(string key, CookieOptions options) 456public CookieOptions Options { get; set; }
Microsoft.AspNetCore.Rewrite (3)
UrlActions\ChangeCookieAction.cs (3)
11private CookieOptions? _cachedOptions; 37var options = GetOrCreateOptions(); 41private CookieOptions GetOrCreateOptions()
Microsoft.AspNetCore.Security.Microbenchmarks (1)
ChunkingCookieManagerBenchmark.cs (1)
16private CookieOptions _cookieOptions;
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
141var cookieOptions = _options.Cookie.Build(_context);
OpenIdConnectSample (1)
Startup.cs (1)
30private void CheckSameSite(HttpContext httpContext, CookieOptions options)
SignalR.Client.FunctionalTestApp (2)
Startup.cs (2)
181var cookieOptions = new CookieOptions(); 182var expiredCookieOptions = new CookieOptions() { Expires = DateTimeOffset.Now.AddHours(-1) };