Codeception / module-yii2

Codeception module for Yii2 framework
MIT License
16 stars 36 forks source link

[Regression] After Yii2 2.0.35 getting cookies does not work prior PHP 7.3 #47

Closed mikk150 closed 3 years ago

mikk150 commented 3 years ago

Since in Yii2 from 2.0.35 samesite is appended to cookie path, then https://github.com/symfony/browser-kit/blob/d528d7fb4570548c3419ee9acb4b231082b6801c/CookieJar.php#L182 fails

https://github.com/yiisoft/yii2/pull/18013

samdark commented 3 years ago

@mikk150 any idea on how to fix that?

mikk150 commented 3 years ago

maybe we could use Symfony\Component\BrowserKit\Cookie::fromString(), that way we do not need to deal with it at all

samdark commented 3 years ago

Hmm... yes. That would be good. Do you have time for a pull request?

mikk150 commented 3 years ago

Bad thing is that yii\web\Cookie::_toString() does not give cookie string, just cookie value, otherwise, it would have been really simple

mikk150 commented 3 years ago

Actually, I think I can fix it in framework, and it will be prettier

samdark commented 3 years ago

Awesome 👍

samdark commented 3 years ago

Merged PR in Yii. Going to be part of the next release.