-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.CookieEngine
libcURL.CookieEngine
Protected Class CookieEngine
This class presents an interface to libcURL's cookie management subsystem (the "cookie engine"). Each instance of EasyHandle has its own cookie engine. To share cookies among several EasyHandles, refer to the ShareHandle class.
The cookie engine works much like that in a web browser: automatically collecting cookies when they are received, inserting them into subsequent requests when appropriate, and deleting them when they expire or a new session is begun. The cookie engine indexes cookies by name and domain. Cookies are only sent if the remote host matches the domain.
You may add/update cookies by calling the SetCookie method. Existing cookies with the same name and domain are overwritten.
You should always specify a domain name when setting cookies, especially if you are connecting to multiple domains. Cookies without a domain (""
) will be sent to all hosts, will not be updated if a website uses the Set-Cookie:
header, and will be sent in addition to any same-named cookies which do specify a domain.
Cookies may have an explicit expiration date; those without one expire at the end of the session. Expired cookies are discarded by the cookie engine; to delete a specific cookie you may change its expiration date to a point in the past (Note: 1/1/1970 00:00:00 GMT is the earliest valid expiration date.)
The cookie engine can optionally load and store cookies in a text file (Netscape cookiejar format).
- Constructor
- Count
- DeleteAll
- Domain
- Expiry
- HTTPOnly
- Invalidate
- Lookup
- Name
- NewSession
- Path
- ReadCookies
- Reload
- SetCookie
- StringValue
- Value
- WriteCookies
- EasyHandle.CookieEngine
- cURLSession.SetCookie
- cURLSession.GetCookie
- HTTP Cookie specification in the libcURL documentation.
- HTTP Cookies Example
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.