CookieStore.UpdateCookie
  • 14 May 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

CookieStore.UpdateCookie

  • Dark
    Light
  • PDF

Article summary

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.

NameRequiredTypeDescription
CookieIDFalse*numericUnique identifier of the cookie.
CookieStoreNameFalsestringThe name of the cookie store.
CookieNameFalsestringThe name of the cookie.
CookieDomainFalsestringThe domain of the cookie.
CookiePathFalsestringThe cookie path.
AllMatchesFalsebooleanTrue 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)

NameRequiredTypeDescription
Cookie.NameFalsestringThe name to update the cookie(s) with.
Cookie.DomainFalsestringThe domain to update the cookie(s) with.
Cookie.ValueFalsestringThe value to update the cookie(s) with.
Cookie.ExpiresFalsestringThe expiration date to update the cookie(s) with.
Cookie.HttpOnlyFalsebooleanThe HttpOnly flag to update the cookie(s) with.
Cookie.SecureFalsebooleanThe Secure flag to update the cookie(s) with.
Cookie.PathFalsestringThe path to update the cookie(s) with.

Responses

NameTypeDescription
ResultstringSuccess if the operation was successful.
CookieStoreIDnumericUnique identifier of the cookie store.
CookieCountnumericThe number of cookies deleted.
CookieIDnumericUnique identifier of the cookie.
CookieNamestringThe 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

<?xml version="1.0" encoding="utf-8"?>
<CookieStoreUpdateCookieResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
	<CookieStoreID>1006</CookieStoreID>
	<CookieCount>1</CookieCount>
	<CookieID>1427</CookieID>
	<CookieName>SetFromApi</CookieName>
</CookieStoreUpdateCookieResponse>

Example response multiple cookies

XML - multiple cookies

<?xml version="1.0" encoding="utf-8"?>
<CookieStoreUpdateCookieResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
	<CookieStoreID>1006</CookieStoreID>
	<CookieCount>2</CookieCount>
	<CookieName>SetFromApi</CookieName>
</CookieStoreUpdateCookieResponse>

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
        }
    }
}

Was this article helpful?