|
enum | CookiePriority { LOW
, MEDIUM
, HIGH
} |
|
enum | SameSite { Lax
, Strict
, None
} |
|
|
| Cookie (string name, string value) |
|
| Cookie (string name, string value, DateTime? expires, string? path, CookiePriority? priority) |
|
| Cookie (string cookieContent) |
|
override string | ToString () |
|
Definition at line 7 of file Cookie.cs.
◆ CookiePriority
enum HSB.Cookie.CookiePriority |
◆ SameSite
◆ Cookie() [1/4]
Definition at line 20 of file Cookie.cs.
21 {
22 name = "";
23 value = "";
24 expiration = null;
25 path = null;
26 priority = null;
27 }
◆ Cookie() [2/4]
HSB.Cookie.Cookie |
( |
string |
name, |
|
|
string |
value |
|
) |
| |
Definition at line 29 of file Cookie.cs.
30 {
31 this.name = name;
32 this.value = value;
33 }
◆ Cookie() [3/4]
HSB.Cookie.Cookie |
( |
string |
name, |
|
|
string |
value, |
|
|
DateTime? |
expires, |
|
|
string? |
path, |
|
|
CookiePriority? |
priority |
|
) |
| |
Definition at line 35 of file Cookie.cs.
36 {
37 this.name = name;
38 this.value = value;
39 expiration = expires;
40 this.path = path;
41 this.priority = priority;
42 }
◆ Cookie() [4/4]
HSB.Cookie.Cookie |
( |
string |
cookieContent | ) |
|
Definition at line 44 of file Cookie.cs.
45 {
46 var s = cookieContent.Split("=");
47 name = s[0];
48 value = s[1];
49 }
◆ ToString()
override string HSB.Cookie.ToString |
( |
| ) |
|
Definition at line 51 of file Cookie.cs.
52 {
53 if (name == "" && value == "")
54 {
56 }
57
58 string cookie = $"{name}={value}";
59
60 if (expiration.HasValue)
61 {
62 cookie += $"; Expires={expiration.Value:ddd, dd MMM yyyy HH:mm:ss 'GMT'}";
63 }
64
65 if (path != null)
66 cookie += $"; Path={path}";
67
68 if (priority.HasValue)
69 cookie += $"; Priority={PriorityToString(priority.Value)}";
70
71 if (secure != null)
72 cookie += "; Secure";
73
74 if (HttpOnly != null)
75 cookie += "; HttpOnly";
76
77 if (sameSite.HasValue)
78 cookie += $"; SameSite={SameSiteToString(sameSite.Value)}";
79
80 return cookie;
81 }
◆ expiration
DateTime? HSB.Cookie.expiration |
◆ HttpOnly
bool? HSB.Cookie.HttpOnly |
◆ name
◆ path
◆ priority
CookiePriority? HSB.Cookie.priority |
◆ sameSite
SameSite? HSB.Cookie.sameSite |
◆ secure
◆ value
The documentation for this class was generated from the following file: