--- title: "CookieStore.AddCookie - Web Scraping API - Mozenda" slug: "cookiestoreaddcookie" description: "Use CookieStore.AddCookie to add a new cookie to an existing cookie store. Cookie stores are great for web scraping projects that require two-factor authentication or CAPTCHA. " updated: 2024-05-14T14:25:21Z published: 2024-05-14T14:25:21Z canonical: "help.mozenda.com/cookiestoreaddcookie" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.mozenda.com/llms.txt > Use this file to discover all available pages before exploring further. # CookieStore.AddCookie ### Description Adds a new **cookie** to an existing **cookie store**. ### URL parameters URL parameter ordering The **URL parameters** below are listed in the order they should be entered in the API **URL**. | Name | Required | Type | Description | | --- | --- | --- | --- | | `CookieStoreID` | True* | numeric | Unique identifier of the **cookie store**. | | `CookieStoreName` | True* | string | The name of the **cookie store**. | | `Cookie.Domain` | True | string | The domain of the **cookie**. | | `Cookie.Name` | True | string | The name of the **cookie**. | | `Cookie.Value` | False | string | The value of the **cookie**. | | `Cookie.Expires` | False | string | The expiration date of format `yyyy-MM-dd`, `yyyy-MM-dd hh:mm:ss`, or in [HTTP date-timestamp format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date). | | `Cookie.HttpOnly` | False | boolean | *Yes*/*True* if the **cookie** is `HttpOnly`. | | `Cookie.Secure` | False | boolean | *Yes*/*True* if the **cookie** is secure. | | `Cookie.Path` | False | string | The **cookie** path. | * Either `CookieStoreID` or `CookieStoreName` is required. ### Responses | Name | Type | Description | | --- | --- | --- | | `Result` | string | `Success` if the operation is successful. | ### Sample request ``` curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=CookieStore.AddCookie&CookieStoreName=Lowes%20Cart&Cookie.Name=SetFromApi&Cookie.Domain=.mozenda.com&Cookie.Value=Test%20value%20from%20api' ``` ### Sample responses #### XML ``` Success 1006 1422 SetFromApi .mozenda.com ``` #### JSON (add `&ResponseFormat=JSON`) ``` { "CookieStoreID": 1001, "CookieID": 1001, "CookieName": "SetFromApi", "CookieDomain": "mozenda.com", "CookiePath": "", "JsonResult": { "Command": "CookieStore.AddCookie", "AutoLoggedIn": false, "WebConsoleKey": "", "Result": "Success", "ErrorCode": "", "ErrorDescription": "", "ErrorList": [], "ExecutionTime": { "Ticks": 0, "Days": 0, "Hours": 0, "Milliseconds": 0, "Minutes": 0, "Seconds": 0, "TotalDays": 0, "TotalHours": 0, "TotalMilliseconds": 0, "TotalMinutes": 0, "TotalSeconds": 0 } } } ```