SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Php sessions

  1. #1
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by y_oda2002 View Post
    Hi everyone,
    I can't seem to get the session to stay alive.
    Explain a little further please, @ what point does the session die ?
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  3. #3
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com

  4. #4
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •