AsyncExtensionsSetCookieAsync 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 will return false without setting
Namespace: CefSharpAssembly: CefSharp (in CefSharp.dll) Version: 129.0.110.0 (129.0.110.0)
Syntax public static Task<bool> SetCookieAsync(
this ICookieManager cookieManager,
string url,
Cookie cookie
)
public:
[ExtensionAttribute]
static Task<bool>^ SetCookieAsync(
ICookieManager^ cookieManager,
String^ url,
Cookie^ cookie
)
Parameters
- cookieManager ICookieManager
- cookie manager
- url String
- The cookie URL. If an empty string is provided, any URL will be matched.
- cookie Cookie
- the cookie to be set
Return Value
TaskBooleanreturns false if the cookie cannot be set (e.g. if illegal charecters such as ';' are used);
otherwise task that represents the set operation. The value of the TResult parameter contains a bool to indicate success.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ICookieManager. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also