roadrunner: Laravel - sessions don't work (cookies problem)
Steps to reproduce
composer create-project --prefer-dist laravel/laravel laravel57cd laravel57- edit env file - database connection
php artisan make:authphp artisan migrate- do this steps: https://github.com/spiral/roadrunner/wiki/Laravel-Framework
rr -v -d- Open browser and go to http://0.0.0.0:8080/register, fill out the form, submit and see the 419 ERROR
Environment
- PHP 7.3
- Laravel 5.7
How to fix it? thanks
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 35 (21 by maintainers)
@wolfy-j @Ostap34JS So, a small update in English because i feel like i figure out a problem. Looks like Laravel doesn’t reset few components with terminate() call and we have to reset it manually. In order to do that, i have to create a wrapper around an application like https://github.com/php-pm/php-pm-httpkernel have. Its already 4AM (4:00) at my place, so i will look into this before the end of the week.
I think, for complete Laravel/Lumen integration with best performance, it will be great to implement same service providers and DI instances resets logic as here https://github.com/swooletw/laravel-swoole/blob/master/config/swoole_http.php#L92-L120
Merged and released.
@wolfy-j @Ostap34JS I think it caused by #93
@barbushin this story has been addressed by #96. Can you please put your ideas/links regarding performance optimizations into separate story so we can avoid loosing it?
Thank you 😃
Thank you for digging in, this explains a lot.
Нащупал что то интерестное. \Illuminate\Auth\SessionGuard не обнуляется при выставлении нового запроса. Теперь надо придумать как его поправить.
@wolfy-j @Ostap34JS при логауте согласно коду он просто обнуляет сессию (атрибуты в []). Но вместе с этим он создает новую сессию и отправляет новую куку с сессией. А дальше начинается веселая часть - при ребуте он то считает что я залогинен, то нет. Такое чувство что прописывает что то в $_SESSION и $_COOKIE, но при дебаге все чисто. Не пойму откуда эта скотина берет не те данные.
@Ostap34JS yeap. Sorry for russian 😃
Проверил в инкогнито и обычном режиме - вс еок. Дает зарегаться и залогинится. Но столкнулся с странным поведением когда я делаю логаут, но он не логаутит. Это я уже хз что за фигня. Возможно где-то не донастроил сесии в ларе.
@Ostap34JS i love Laravel. Not it doesn’t see cookies… in some cases.