472,119 Members | 992 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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_expire(240);
$cache_expire = session_cache_expire();
session_start();
include('functions.php');
$naam_l = '';

if (isset($_SESSION['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

Jul 23 '07 #1
1 3013
Rik
On Mon, 23 Jul 2007 20:47:31 +0200, Rogier <r.************@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_expire(240);
$cache_expire = session_cache_expire();
session_start();
include('functions.php');
$naam_l = '';
RTFM:
session.cache_expire integer
session.cache_expire specifies time-to-live for cached session pages in
minutes

session.gc_maxlifetime integer
session.gc_maxlifetime 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_expire/public)", NOT for timing out
sessions.

So, set session.gc_maxlifetime to an appropriate value.
--
Rik Wasmus
Jul 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

27 posts views Thread by mrbog | last post: by
5 posts views Thread by Mark Rodrigues | last post: by
1 post views Thread by lsf_80 | last post: by
6 posts views Thread by Gonenc Ercan | last post: by
reply views Thread by George | last post: by
14 posts views Thread by Sergei Shelukhin | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.