id: thttpcookie title: THttpCookie
An HTTP Cookie representation.
HTTP cookies are small pieces of data that a server asks a client (such as a web browser or HTTP client) to store and send back with subsequent requests. They are most commonly used to maintain state across multiple HTTP requests, since HTTP itself is a stateless protocol.
Cookies are typically used for:
When a server includes a Set-Cookie header in an HTTP response, the client may store the
cookie according to its attributes (such as domain, path, expiration time, and security
flags). On later requests, the client automatically sends matching cookies back to the
server using the Cookie request header.
An HTTP cookie may define:
THttpCookie represents a single HTTP cookie and provides access to its properties, allowing applications to inspect, store, and manage cookies as part of HTTP client communication.
Method GetName:String() OverrideGets the cookie name.
Method GetValue:String() OverrideGets the cookie value.
Method GetVersion:Int() OverrideGets the cookie version.
Method GetComment:String() OverrideGets the 'Comment' attribute value.
Method GetDomain:String() OverrideGets the 'Domain' attribute value.
Method GetPath:String() OverrideGets the 'Path' attribute value.
Method GetMaxAge:Long() OverrideGets the 'Max-Age' attribute value.
Method GetSameSite:String() OverrideGets the 'SameSite' attribute value.
Method GetExpires:Long() OverrideGets the 'Expires' attribute value.
Returns the expiration date of the cookie as a Unix timestamp, or zero if not set or invalid.
Method IsPartitioned:Int() OverrideReturns whether the 'Partitioned' attribute is set.
Method IsHttpOnly:Int() OverrideReturns whether the 'HttpOnly' attribute is set.
Method IsSecure:Int() OverrideReturns whether the 'Secure' attribute is set.
Method IsExpired:Int() OverrideReturns whether the cookie has expired.
Method GetAttribute:String(attr:ECookieAttribute)Gets the attribute value by enum.
Method GetAttribute:String(attr:String)Gets the attribute value by string key.
Function Build:THttpCookieBuilder(name:String, value:String, version:Int = 0)Creates a new HTTP cookie builder.