0

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> 
1
  • Are you sure that your session lifetime has been extended ? The session.gc_maxlifetime has a default value of 1440 (24 minutes). session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up Note: If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data. -> From documentation Commented Oct 1 at 8:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.