Veriteworks / CookieFix

Fix Magento2.2/2.3/2.4 Cookie SameSite attribute
Academic Free License v3.0
65 stars 35 forks source link

Error can not switch between stores #26

Open divivu opened 3 years ago

divivu commented 3 years ago

error.log Hi, Thank you for your module! It help fixed the issue but I see an error when config "Same Site" is "None" and switch between stores. "The store cannot be switched." err

I'm using your module version 3.0.0 on magento 2.4.1. Log file attached. Thank you!

vpsnak commented 3 years ago

Hey, i had this issue you can either find a way to override this class of directly edit it in vendor.

vendor/magento/module-store/Model/StoreSwitcher/ManagePrivateContent.php Line 56 you need to setSecure(true) when using SameSite none

I DO NOT recommend edit it in vendor.

I am using Magento 2.4.1 and i was getting this error [2021-03-29 19:12:28] main.CRITICAL: The store cannot be switched. {"report_id":"8cdac15d94123a3db6111cc3ddb29100d7fb1448eeefea0372b456045a1ab3ab","exception":"[object] (Magento\Store\Model\StoreSwitcher\CannotSwitchStoreException(code: 0): The store cannot be switched. at /home/fistikato/public_html/vendor/magento/module-store/Model/StoreSwitcher/ManagePrivateContent.php:64, InvalidArgumentException(code: 0): Cookie must be secure in order to use the SameSite None directive. at /home/fistikato/public_html/vendor/magento/framework/Stdlib/Cookie/CookieMetadata.php:165)"} []

bsdnomad commented 3 years ago

https://github.com/Veriteworks/CookieFix/pull/30