-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCookieOptions.cs
47 lines (40 loc) · 1.07 KB
/
CookieOptions.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
using System;
namespace Inversion.Web {
/// <summary>
/// A builder class used to describe the properties of
/// a cookie.
/// </summary>
public class CookieOptions {
/// <summary>
/// The path of the cookie.
/// </summary>
public string Path { get; set; }
/// <summary>
/// The domain of the cookie.
/// </summary>
public string Domain { get; set; }
/// <summary>
/// Whether or not the cookie is http only.
/// </summary>
public bool HttpOnly { get; set; }
/// <summary>
/// Whether or not the cookie is secured.
/// </summary>
public bool Secure { get; set; }
/// <summary>
/// When the cookie should expire.
/// </summary>
public DateTime? Expires { get; set; }
/// <summary>
/// Creates a new cookie options object with the default path of "/".
/// </summary>
public CookieOptions() : this("/") {}
/// <summary>
/// Creates a new cookie options object with the path specified.
/// </summary>
/// <param name="path">The path of the cookie.</param>
public CookieOptions(string path) {
this.Path = path;
}
}
}