ICookieStoreSetCookie Method |
Sets a session cookie given explicit user-provided cookie attributes.
Namespace:
DotNetBrowser.Cookies
Assembly:
DotNetBrowser (in DotNetBrowser.dll) Version: 2.27.3
Syntax Task<bool> SetCookie(
Cookie cookie
)
Parameters
- cookie
- Type: DotNetBrowser.CookiesCookie
An HTTP cookie.
Return Value
Type:
TaskBooleantrue when session cookie was inserted successfully,
false otherwise.
Exceptions Exception | Condition |
---|
ArgumentException |
The cookie is null or the cookie cannot be set.
|
ObjectDisposedException | The ICookieStore has already been disposed. |
Remarks
If you set the cookie successfully and the method returns true and you
decide to find the cookie in the list of all cookies, please note that
the cookie storage can modify some cookies attributes, such as domain or expiration time.
See Also