I am using Laravel 5 (version laravel / framework "v5.1.16", Homestead Ubuntu), with session = 'file' driver.
I noticed that if multiple asynchronous AJAX requests (jQuery) are being executed, for example. in the autocomplete form field, then the session variables disappeared.
This only happens with async AJAX requests, when the async option is set to false, this problem no longer exists.
Also, when the session driver is set to cookie and async is set to true, a new cookie is created in each AJAX request, so 10 larvel files, etc., will be created with 10 requests.
Any suggestions? I was not able to find any decent reason or solution for this, except for using asynchronous requests.
Related issues that appear to be fixed.
https://github.com/laravel/framework/issues/7549
https://github.com/laravel/framework/issues/5416
source share