--- title: "CookieStore.UpdateCookie - Web Scraping API - Mozenda" slug: "cookiestoreupdatecookie" description: "Typo? No problem. Use CookieStore.UpdateCookie to modify the name and/or description of an existing cookie. Make use of cookies for web scraping projects that require CAPTCHAs or two-factor authentication. " updated: 2024-05-14T14:25:39Z published: 2024-05-14T14:25:39Z canonical: "help.mozenda.com/cookiestoreupdatecookie" --- > ## 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.UpdateCookie ### Description Updates an existing **cookie**. ### URL parameters (cookie selection) URL parameter ordering The **URL parameters** below are listed in the order they should be entered in the API **URL**. | Name | Required | Type | Description | | --- | --- | --- | --- | | `CookieID` | False* | numeric | Unique identifier of the **cookie**. | | `CookieStoreName` | False | string | The name of the **cookie store**. | | `CookieName` | False | string | The name of the **cookie**. | | `CookieDomain` | False | string | The domain of the **cookie**. | | `CookiePath` | False | string | The **cookie** path. | | `AllMatches` | False | boolean | *True* to update all **cookies** that match the given **criteria**. | * You can identify the **cookie** to be updated with `CookieID` or with at least `CookieStoreName` and `CookieName`. Note If you don't use `CookieID` *and* multiple **cookies** match the **parameters** while `AllMatches`=`true` is not included in the **parameters**, then an error will be returned. ### URL parameters (cookie update) | Name | Required | Type | Description | | --- | --- | --- | --- | | `Cookie.Name` | False | string | The name to update the **cookie(s)** with. | | `Cookie.Domain` | False | string | The domain to update the **cookie(s)** with. | | `Cookie.Value` | False | string | The value to update the **cookie(s)** with. | | `Cookie.Expires` | False | string | The expiration date to update the **cookie(s)** with. | | `Cookie.HttpOnly` | False | boolean | The `HttpOnly` flag to update the **cookie(s)** with. | | `Cookie.Secure` | False | boolean | The `Secure` flag to update the **cookie(s)** with. | | `Cookie.Path` | False | string | The path to update the **cookie(s)** with. | ### Responses | Name | Type | Description | | --- | --- | --- | | `Result` | string | `Success` if the operation was successful. | | `CookieStoreID` | numeric | Unique identifier of the **cookie store**. | | `CookieCount` | numeric | The number of **cookies** deleted. | | `CookieID` | numeric | Unique identifier of the **cookie**. | | `CookieName` | string | The name of the **cookie**. | The result of the operation includes the `CookieStoreID` and `CookieCount`. If only one **cookie** was deleted, then the `CookieID` and the `CookieName` will also be included. ### Sample request ``` curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=CookieStore.UpdateCookie&CookieStoreName=Lowes%20Cart&CookieName=SetFromApi&Cookie.Value=Updated%20from%20cookiestore.update%20api' ``` ### Sample responses #### XML - single cookie ``` Success 1006 1 1427 SetFromApi ``` #### Example response multiple cookies #### XML - multiple cookies ``` Success 1006 2 SetFromApi ``` #### JSON (add `&ResponseFormat=JSON`) ``` { "CookieStoreID": 1002, "CookieCount": 1, "CookieID": 1013, "JsonResult": { "Command": "CookieStore.UpdateCookie", "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 } } } ```