Click or drag to resize

ICookieStoreSetCookie Method

Sets a session cookie given explicit user-provided cookie attributes.

Namespace:  DotNetBrowser.Cookies
Assembly:  DotNetBrowser (in DotNetBrowser.dll) Version: 2.13.0
Syntax
C#
Task<bool> SetCookie(
	Cookie cookie
)

Parameters

cookie
Type: DotNetBrowser.CookiesCookie
An HTTP cookie.

Return Value

Type: TaskBoolean
true when session cookie was inserted successfully, false otherwise.
Exceptions
ExceptionCondition
ArgumentException The cookie is null or the cookie cannot be set.
ObjectDisposedExceptionThe 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