SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Php sessions
-
Jul 3, 2007, 11:04 #1
Php sessions
Hi everyone,
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.
Thanks,
Nick
-
Jul 3, 2007, 11:23 #2
- Join Date
- Aug 2005
- Posts
- 453
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jul 3, 2007, 11:55 #3
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
-
Jul 3, 2007, 13:21 #4
- Join Date
- Jun 2004
- Location
- Copenhagen, Denmark
- Posts
- 6,157
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
Bookmarks