skip to Main Content

I’m working on shopify extension on php codeigniter. 7.1 php version.
I’m receiving this error while i’m installing extension on shopify.
The app couldn’t be loaded
Then i add this code in the default controller:

header('Set-Cookie: same-site-cookie=foo; SameSite=Lax');
header('Set-Cookie: cross-site-cookie=bar; SameSite=None; Secure');

But still i’m receiving above error. Even the cookie was created as i check it on Application > Storage > Cookies.
Can anyone guide me that what is missing or why i’m still getting this error on chrome 80.
Thanks!
Find the attachments.
https://ibb.co/fFpSsZj
https://ibb.co/LdT6Zdq

2

Answers


  1. Chosen as BEST ANSWER

    Its working fine now. The solution is to go to chrome://flags and search for samesite and try to disable SameSite by default cookies and Cookies without SameSite must be secure options. Go to your app again, the error will hide. then go to Application > Storage > Cookies and check the app cookie which was created already. It may be include session id in the cookie. just replace this cookie including this SameSite=none, secure with same name,values etc and then again revert your flags settings and reload the app. It will work fine. Thanks!


  2. Why did you decide that cookie is an issue? You might want to check the path to your app in settings or some other internal errors.

    Anyway, if you’re sure the problem is in your cookies – what you’re trying to set up, just doesn’t make any sense. I assume you just found an example somewhere and tried blindly add this into your app, without understanding.

    1. Use the second construction. That’s an example required for cookies set up from within the embedded application to work.

    2. cross-site-cookie=bar is just an example of a cookie to set up. You should replace this with your key-value pair everywhere you’re setting up cookies in your app.

    3. Add false as a second parameter to the header() function to allow setting up multiple cookies at a time.

    Here’s an example:

    header('Set-Cookie: username=John; Path=/; SameSite=None; Secure', false);
    header('Set-Cookie: age=30; Path=/; SameSite=None; Secure', false);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search