Is the PHP session not renewed when using Ajax?

Asked

Viewed 64 times

1

I have a scheduling page where every 30 seconds send (in background) an ajax request to know what times are still available, if there is an error I show a popup (bootstrap) with error information, it works 99%.

The 1% is because the following happens, if the user stays long without interacting with the system, he disconnects and shows the login page inside the popup and this ends up being an inconvenience because it disturbs the system.

Well, I’m doing a redirect routine if the session is expired so the user can log in again, but it doesn’t seem right.

The question is: If I make a request every 30 seconds with ajax, PHP should not keep the session active?

I’m using friendly Urls where every page request is made by going through the index.php file and in it I have all the default system settings.

The system is running round except for this fact of automatic disconnection and session loss.

I’ve pondered and looked on the web about this behavior php, but it was not clear how to solve.

As the system is complex because it involves several other things on the same page, putting code here will be kind of complicated, I hope the post give an idea of my problem.

  • 1

    You would need to renew the session with each ajax request, there is a good explanation here https://answall.com/a/167627/64053

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.