Hopefully this question is in the right forum since it deals mostly with php.
I need to refresh php sessions via ajax.
I figured that all I would have to do is simply send an ajax request to the server where the script does nothing other than set a session variable to keep the session alive. This does not seem to be working. Is there something I can do via ajax/php to send a request back to the server without reloading the page in order for a user to keep their session information alive. I have tried several different things: setting session variables on the called script, sending information back. I can't seem to get the session to stay alive.
Any help would be greatly appreciated.
Explain a little further please, @ what point does the session die ?
Originally Posted by y_oda2002
The session dies at the stated amount of seconds in the configuration file.
I.E. If sessions are set to expire after 20 minutes of inactivity then that is when the session expires. I'm looking for a way to let the server know the session is still active only the browser page has not been refreshed.
Hope that helps
The obvious solution is to change the ini-settings, but I suppose you don't have that option? You can't simply fire a XmlHttpRequest, since this will not carry the session-cookie, and so won't "poll" the session. You'll have to manually assign the cookie as a header to your XmlHttpRequest.