phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
569 stars 211 forks source link

For security reasons, requests using HTTP Basic Authentication cannot include cookies #202

Open oscarfabiano opened 3 years ago

oscarfabiano commented 3 years ago

Hello, Recently I've started receiving this error when trying to fulfill orders on Shopify.

For security reasons, requests using HTTP Basic Authentication cannot include cookies

$this->config = array( 'ShopUrl' => env('API_SHOPIFY_STORE_NAME') . '.myshopify.com', 'ApiKey' => env('API_SHOPIFY_KEY'), 'Password' => env('API_SHOPIFY_PASSWORD'), 'ApiVersion' => '2021-01' );

Any clue? Should I send any extra parameters?

Thanks,

driade commented 3 years ago

Same here, looking for some clue...

jonada182 commented 3 years ago

Hey guys, I am experiencing the same issue here. I found a temporary solution and it's by disabling the session cookies before running any POST requests. Just remember to enable this option again once the request is sent.

     ini_set('session.use_cookies', '0');
     // Code goes here
     ini_set('session.use_cookies', '1');

Hope it works for you.

Thanks,

driade commented 3 years ago

@jonada182 Thanks a lot. It's incredible it works in my case, because it runs on a queue without (supposedly) sessions!