Cookie Class#
Represents a browser cookie.
public sealed record Cookie : System.IEquatable<Motus.Abstractions.Cookie>
Inheritance System.Object → Cookie
Implements System.IEquatable<Cookie>
Constructors#
Cookie(string, string, string, string, double, bool, bool, SameSiteAttribute) Constructor#
Represents a browser cookie.
public Cookie(string Name, string Value, string Domain, string Path, double Expires, bool HttpOnly, bool Secure, Motus.Abstractions.SameSiteAttribute SameSite);
Parameters#
Name System.String
The cookie name.
Value System.String
The cookie value.
Domain System.String
The cookie domain.
Path System.String
The cookie path.
Expires System.Double
The cookie expiration time as a Unix timestamp, or -1 for session cookies.
HttpOnly System.Boolean
Whether the cookie is HTTP-only.
Secure System.Boolean
Whether the cookie requires a secure connection.
SameSite SameSiteAttribute
The cookie SameSite attribute.
Properties#
Domain Property#
The cookie domain.
public string Domain { get; init; }
Property Value#
Expires Property#
The cookie expiration time as a Unix timestamp, or -1 for session cookies.
public double Expires { get; init; }
Property Value#
HttpOnly Property#
Whether the cookie is HTTP-only.
public bool HttpOnly { get; init; }
Property Value#
Name Property#
The cookie name.
public string Name { get; init; }
Property Value#
Path Property#
The cookie path.
public string Path { get; init; }
Property Value#
SameSite Property#
The cookie SameSite attribute.
public Motus.Abstractions.SameSiteAttribute SameSite { get; init; }
Property Value#
Secure Property#
Whether the cookie requires a secure connection.
public bool Secure { get; init; }
Property Value#
Value Property#
The cookie value.
public string Value { get; init; }