NetworkClientSetCookieAsync Method |
Version 88.2.90
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
Namespace:
CefSharp.DevTools.Network
Assembly:
CefSharp (in CefSharp.dll) Version: 88.2.90.0 (88.2.90.0)
Syntax public Task<SetCookieResponse> SetCookieAsync(
string name,
string value,
string url = null,
string domain = null,
string path = null,
Nullable<bool> secure = null,
Nullable<bool> httpOnly = null,
Nullable<CookieSameSite> sameSite = null,
Nullable<long> expires = null,
Nullable<CookiePriority> priority = null
)
public:
Task<SetCookieResponse^>^ SetCookieAsync(
String^ name,
String^ value,
String^ url = nullptr,
String^ domain = nullptr,
String^ path = nullptr,
Nullable<bool> secure = nullptr,
Nullable<bool> httpOnly = nullptr,
Nullable<CookieSameSite> sameSite = nullptr,
Nullable<long long> expires = nullptr,
Nullable<CookiePriority> priority = nullptr
)
Parameters
- name
- Type: SystemString
Cookie name. - value
- Type: SystemString
Cookie value. - url (Optional)
- Type: SystemString
The request-URI to associate with the setting of the cookie. This value can affect thedefault domain and path values of the created cookie. - domain (Optional)
- Type: SystemString
Cookie domain. - path (Optional)
- Type: SystemString
Cookie path. - secure (Optional)
- Type: SystemNullableBoolean
True if cookie is secure. - httpOnly (Optional)
- Type: SystemNullableBoolean
True if cookie is http-only. - sameSite (Optional)
- Type: SystemNullableCookieSameSite
Cookie SameSite type. - expires (Optional)
- Type: SystemNullableInt64
Cookie expiration date, session cookie if not set - priority (Optional)
- Type: SystemNullableCookiePriority
Cookie Priority type.
Return Value
Type:
TaskSetCookieResponsereturns System.Threading.Tasks.Task<SetCookieResponse>
See Also