CodeIgniter Forums
Cannot login with CI4 after updating Chrome? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Cannot login with CI4 after updating Chrome? (/thread-78394.html)



Cannot login with CI4 after updating Chrome? - blaasvaer - 01-13-2021

I've updated Chrome, and made sure ALL cookies are allowed ... but I can no longer login to an admin created. I use a third-party 'plug-in' ... but as the author has added absolutely no information about this, I have no clue where I got it ... yes, I know, that's just ONE reason for not using it.

But my point is, I didn't do anything to my code ... it just stopped working after updateing Chrome (still works fine in FireFox etc.). So, I'm pretty sure it has to do with Google seriously fucking with cookies for the time being.

So, if anyone has any idea about how I can fix this without having to spend DAYs googling the crap out of it (huh, it this actually a strategy by Google ... breaking stuff so we have to Google shit, so they can sell more adds? – well, just a thought), I'd be more that happy to hear of them.

Thanks ...


RE: Cannot login with CI4 after updating Chrome? - paulbalandan - 01-13-2021

Please check in Chrome Dev Tools if there are errors reported in the console. If this is with cookies I suspect this may be due to CORS issue or with the SameSite attribute.


RE: Cannot login with CI4 after updating Chrome? - InsiteFX - 01-13-2021

If it's a CORS problem you can try adding this to your .htaccess file in the root with index.php

Code:
<IfModule mod_headers.c>
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg|svgz|jpg|png|ico|font.css|css|js)$">
        ## Change this to your website URL not * "https://your_site.com"##
        Header set Access-Control-Allow-Origin "*"
        Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
        Header add Access-Control-Allow-Headers: "Upgrade-Insecure-Requests"
    </FilesMatch>
</IfModule>

Chrome is getting very strict on all this CORS stuff so best to learn it.


RE: Cannot login with CI4 after updating Chrome? - blaasvaer - 01-13-2021

Turned out I had to change the SameSite to Lax ... and remove Secure ... weird that it worked until the update.


RE: Cannot login with CI4 after updating Chrome? - InsiteFX - 01-13-2021

Glad you got it to work, I would still copy the code I posted because you will run
into more problems with CORS and using assets etc;