I'm using laravel 8 with SESSION_DRIVER=file
I have code that run like below, and I have a problem why the recursive not extending the expired time of session?
Each process take 30sec, but after processed 10-30min, session expired and user was logged out, even though I set the session lifetime 120min.
$("#formData").submit(function(e) { e.preventDefault() var formData = $(this).serializeArray(); var ajaxCall = function(id = null) { return new Promise(function(resolve, reject){ $.ajax({ method: "POST", url: $(this).attr("action") data: formData success: function(res) { if(res.continue){ ajaxCall(res.id).then(function(res) { resolve(res) }).catch(function(err) { reject(err) }) } } }) } } ajaxCall().then(function(res){ resolve(res); }); }) <form id="formData" action="process" method="POST"> {{ csrf_field() }} ... </form>