I have a group of PHP scripts that interact with a handful of stores that sell our product. I import the orders, update tracking, and feed our inventory. These are all private apps that only run on our server.
Out of nowhere today, I started getting this error “{“errors”:“For security reasons, requests using HTTP Basic Authentication cannot include cookies.”}” when trying to use any POST requests (update tracking, inventory), I get this error.
I have no cookies that I am aware of, this is the CURL request for tracking:
Yes, I think I just started seeing this too around 11 a.m. The server is responding with a 301 (which our code follows implicitly) that takes you to a weird login page. I can see the same cookie message in Postman, but the cookies dialog is empty and as far as I’m aware, no cookies are being sent.
Seeing the same here, working for months until about 2 hours ago, I was head scratching to see if I’d missed an API update that broke my code. I’m getting: “Error: For security reasons, requests using HTTP Basic Authentication cannot include cookies.” - this was working fine, its resulting from trying to create a Customer (with metafields) via PHP
I’m curious if this was a future change accidentally rolled out too soon (and since reverted), thus I will need to make changes to my code at some point anyways?
For OP, something like this should clear out the cookies before a request:
curl_setopt( $ch, CURLOPT_COOKIELIST, 'ALL' );
But I’m not sure if the API did pass a Set-Cookie header, and the no-cookies rule was then being randomly enforced by the API, or what happened since it resolved before I could collect enough data from this inherited app.
I am guessing there was some code released that was incorrectly falsely flagging every request as having cookies, because the requests we were sending certainly did not have cookies but were still getting 301 redirected.
Thanks. I noticed that too for the change in 2017.
This private app didn’t have explicit code to clear any cookies before the next API request, so I wasn’t certain if it was possibly sending a cookie it received from the Shopify API, or not.
It has the code now to clear out any cookies before each request in the mean time, which hopefully is fine until this app can be rebuilt.