ICookieManagerSetCookie Method |
Version 130.1.90
Sets a cookie given a valid URL and explicit user-provided cookie attributes. This function expects each attribute to be well-formed. It will check for disallowed
characters (e.g. the ';' character is disallowed within the cookie value attribute) and fail without setting the cookie if such characters are found.
This method will be executed on the CEF UI thread in an async fashion, to be notified upon completion implement
ISetCookieCallback
and pass in as
callback Namespace: CefSharpAssembly: CefSharp (in CefSharp.dll) Version: 129.0.110.0 (129.0.110.0)
Syntax bool SetCookie(
string url,
Cookie cookie,
ISetCookieCallback callback = null
)
bool SetCookie(
String^ url,
Cookie^ cookie,
ISetCookieCallback^ callback = nullptr
)
Parameters
- url String
- The cookie URL
- cookie Cookie
- The cookie
- callback ISetCookieCallback (Optional)
- If non-NULL it will be executed asynchronously on the CEF UI thread after the cookie has been set.
Return Value
BooleanReturns false if an invalid URL is specified or if cookies cannot be accessed.
See Also