By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

Session time out too fast

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.