1
1
// Copyright (c) .NET Foundation. All rights reserved.
2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
+ using Microsoft . AspNetCore . Builder ;
4
5
using Microsoft . AspNetCore . Http ;
5
6
6
7
namespace Microsoft . AspNetCore . CookiePolicy
7
8
{
9
+ /// <summary>
10
+ /// Context for <see cref="CookiePolicyOptions.OnAppendCookie"/> that allows changes to the cookie prior to being appended.
11
+ /// </summary>
8
12
public class AppendCookieContext
9
13
{
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>
10
21
public AppendCookieContext ( HttpContext context , CookieOptions options , string name , string value )
11
22
{
12
23
Context = context ;
@@ -15,12 +26,40 @@ public AppendCookieContext(HttpContext context, CookieOptions options, string na
15
26
CookieValue = value ;
16
27
}
17
28
29
+ /// <summary>
30
+ /// Gets the <see cref="HttpContext"/>.
31
+ /// </summary>
18
32
public HttpContext Context { get ; }
33
+
34
+ /// <summary>
35
+ /// Gets the <see cref="Http.CookieOptions"/>.
36
+ /// </summary>
19
37
public CookieOptions CookieOptions { get ; }
38
+
39
+ /// <summary>
40
+ /// Gets or sets the cookie name.
41
+ /// </summary>
20
42
public string CookieName { get ; set ; }
43
+
44
+ /// <summary>
45
+ /// Gets or sets the cookie value.
46
+ /// </summary>
21
47
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>
22
52
public bool IsConsentNeeded { get ; internal set ; }
53
+
54
+ /// <summary>
55
+ /// Gets a value that determines if cookie consent was provided.
56
+ /// </summary>
23
57
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>
24
63
public bool IssueCookie { get ; set ; }
25
64
}
26
- }
65
+ }
0 commit comments