Session time out too fast

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rogier

    Session time out too fast

    Hello,

    I made a simple script with some session variables. When I work in the
    application, and when I don't use the application for some time, the
    session vars are erased... even when I set the session time out for 4
    hours....

    Here is a part of the code:

    <?PHP
    session_cache_e xpire(240);
    $cache_expire = session_cache_e xpire();
    session_start() ;
    include('functi ons.php');
    $naam_l = '';

    if (isset($_SESSIO N['a_name'])) $naam_l = $_SESSION['a_name'];

    How is it possible that the vars don't work anymore , for example
    within 30 min?
    Is there maybe a problem in IE6? How can I debug this problem....

    Greetings and thanks,

    Ronald,
    Vlaardingen - The Netherlands

  • Rik

    #2
    Re: Session time out too fast

    On Mon, 23 Jul 2007 20:47:31 +0200, Rogier <r.e.vanijperen @gmail.com
    wrote:
    Hello,
    >
    I made a simple script with some session variables. When I work in the
    application, and when I don't use the application for some time, the
    session vars are erased... even when I set the session time out for 4
    hours....
    >
    Here is a part of the code:
    >
    <?PHP
    session_cache_e xpire(240);
    $cache_expire = session_cache_e xpire();
    session_start() ;
    include('functi ons.php');
    $naam_l = '';
    RTFM:
    session.cache_e xpire integer
    session.cache_e xpire specifies time-to-live for cached session pages in
    minutes

    session.gc_maxl ifetime integer
    session.gc_maxl ifetime specifies the number of seconds after which data
    will be seen as 'garbage' and cleaned up. Garbage collection occurs during
    session start

    The 'cache expire' is for:"cache control method to use for session pages
    (none/nocache/private/private_no_expi re/public)", NOT for timing out
    sessions.

    So, set session.gc_maxl ifetime to an appropriate value.
    --
    Rik Wasmus

    Comment

    Working...