Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Location
    India
    Posts
    49

    Question PHP Session are expiring

    Hi,
    Some of our sites we hosted on Red Hat 7.3 Linux with CPanel are using php where we are using session variable.
    As per testing sesssions are expiring soon afer creation of it or within 10 seconds..
    Can any one tell me why & whats the solutions

  2. #2
    Join Date
    Mar 2004
    Posts
    98
    Check your PHP.ini file (most likely located in your /usr/local/lib directory) for the "max_execution_time" setting. If it isn't set to anything try this and see if that helps:

    max_execution_time=30

    (for 30 second)


    Hope that helps,
    Tim

  3. #3
    Join Date
    Jun 2003
    Posts
    673
    Uh, this shouldn't have anything to do with the script execution time, should it?

    Look at session.gc_maxlifetime in your php.ini file and try increasing it if it's low.

  4. #4
    Join Date
    Mar 2004
    Posts
    98
    I don't think "session.gc_maxlifetime" will effect a script proceess halting. "session.gc_maxlifetime" is concerned with garbage collection, not maximum execution time.

    From the PHP.ini file:
    ; After this number of seconds, stored data will be seen as 'garbage' and
    ; cleaned up by the garbage collection process.
    session.gc_maxlifetime =
    Tim

  5. #5
    Join Date
    Jun 2003
    Posts
    673
    Why are you talking about maximum execution time? The original poster's problem was that sessions were expiring too quickly. :)

  6. #6
    Join Date
    Mar 2004
    Location
    Belgium
    Posts
    1
    We have experienced the same problem with a few websites on our Red Hat 7.3 server.
    Sessions are lost randomly (sometimes everything works fine for a few minutes, sometimes every session is lost after a refresh/opening of new page).

    I have tried several different settings in php.ini (only cookies, changing other values) but nothing works. We experienced these problems after an upgrade from PHP 4.3.2 to 4.3.3

    I have heard that other programmers experienced the same problems, and that this was the case with an older version of PHP which showed up again in PHP 4.3.3

    Google or the PHP bug list does not show an identical situation (many problems with sessions, but none like what I experience).

    I have temporarily moved the sites to a Windows server, and there I have no problem at all (as far as I could test, I still keep a big eye on it).

    I first suspected that it would be an Internet Explorer bug, but the same behaviour shows up in Mozilla 1.6

    If anyone has an idea, I would greatly appreciate it.

  7. #7
    Join Date
    Jul 2003
    Location
    India
    Posts
    43
    Please check the following values in the httpd.conf file

    KeepAliveTimeout 15
    MaxKeepAliveRequests 100

  8. #8
    Join Date
    Feb 2004
    Posts
    772
    Hi,

    Check the session setting ( timing ) in your php.ini file. Check whether session_register() variable is used and then session_start function is validated.

    For more information on Sessions in PHP please have a look into this URL.

    http://in2.php.net/manual/en/ref.session.php

    Please have a look into this URL for example of session settings

    http://www.massless.org/_tests/phpgetvars/

    Regards,

    Bright

Posting Permissions

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