-
Notifications
You must be signed in to change notification settings - Fork 171
/
IHttpCookie.cs
63 lines (53 loc) · 2.05 KB
/
IHttpCookie.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace Microsoft.Azure.Functions.Worker.Http
{
/// <summary>
/// A representation of an HTTP cookie
/// </summary>
public interface IHttpCookie
{
/// <summary>
/// Gets or sets the allowed hosts to receive the cookie.
/// </summary>
string? Domain { get; }
/// <summary>
/// Gets or sets experation date of the cookie. An experation date sets the
/// cookie to expire at a specific date instead of when the client closes.
/// NOTE: It is generally recommended that you use MaxAge over Expires.
/// </summary>
DateTimeOffset? Expires { get; }
/// <summary>
/// Gets or sets the HttpOnly attributes on the cookie. A value of true will make
/// the cookie inaccessible to JavaScript's Document.cookie API.
/// </summary>
bool? HttpOnly { get; }
/// <summary>
/// Gets or sets the number of seconds until the cookie expires. A zero or negative
/// number will expire the cookie immediately.
/// </summary>
double? MaxAge { get; }
/// <summary>
/// Gets or sets the cookie name.
/// </summary>
string Name { get; }
/// <summary>
/// Gets or sets the URL path that must exist in the requested URL.
/// </summary>
string? Path { get; }
/// <summary>
/// Gets or sets an option to restrict the cookie to not be sent with cross-site requests.
/// </summary>
SameSite SameSite { get; }
/// <summary>
/// Gets or sets the Secure attribute on the cookie. A value of true will ensure that the cookie
/// is only sent with encrypted requests over HTTPS.
/// </summary>
bool? Secure { get; }
/// <summary>
/// Gets or sets the cookie value.
/// </summary>
string Value { get; }
}
}