11// Copyright (c) .NET Foundation. All rights reserved.
22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
4+ using Microsoft . AspNetCore . Builder ;
45using Microsoft . AspNetCore . Http ;
56
67namespace Microsoft . AspNetCore . CookiePolicy
78{
9+ /// <summary>
10+ /// Context for <see cref="CookiePolicyOptions.OnAppendCookie"/> that allows changes to the cookie prior to being appended.
11+ /// </summary>
812 public class AppendCookieContext
913 {
14+ /// <summary>
15+ /// Initializes a new instance of <see cref="AppendCookieContext"/>.
16+ /// </summary>
17+ /// <param name="context">The request <see cref="HttpContext"/>.</param>
18+ /// <param name="options">The <see cref="Http.CookieOptions"/> passed to the cookie policy.</param>
19+ /// <param name="name">The cookie name.</param>
20+ /// <param name="value">The cookie value.</param>
1021 public AppendCookieContext ( HttpContext context , CookieOptions options , string name , string value )
1122 {
1223 Context = context ;
@@ -15,12 +26,40 @@ public AppendCookieContext(HttpContext context, CookieOptions options, string na
1526 CookieValue = value ;
1627 }
1728
29+ /// <summary>
30+ /// Gets the <see cref="HttpContext"/>.
31+ /// </summary>
1832 public HttpContext Context { get ; }
33+
34+ /// <summary>
35+ /// Gets the <see cref="Http.CookieOptions"/>.
36+ /// </summary>
1937 public CookieOptions CookieOptions { get ; }
38+
39+ /// <summary>
40+ /// Gets or sets the cookie name.
41+ /// </summary>
2042 public string CookieName { get ; set ; }
43+
44+ /// <summary>
45+ /// Gets or sets the cookie value.
46+ /// </summary>
2147 public string CookieValue { get ; set ; }
48+
49+ /// <summary>
50+ /// Gets a value that determines if cookie consent is required before setting this cookie.
51+ /// </summary>
2252 public bool IsConsentNeeded { get ; internal set ; }
53+
54+ /// <summary>
55+ /// Gets a value that determines if cookie consent was provided.
56+ /// </summary>
2357 public bool HasConsent { get ; internal set ; }
58+
59+ /// <summary>
60+ /// Gets or sets a value that determines if the cookie can be appended. If set to <see langword="false" />,
61+ /// the cookie is not appended.
62+ /// </summary>
2463 public bool IssueCookie { get ; set ; }
2564 }
26- }
65+ }
0 commit comments