For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > September 2005 > #34588 [Opn->Ver]: Local session.gc_maxlifetime not always being respected









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #34588 [Opn->Ver]: Local session.gc_maxlifetime not always being respected
marcot@php.net

2005-09-23, 6:57 pm

ID: 34588
Updated by: marcot@php.net
Reported By: michael dot caplan at htc dot ca
-Status: Open
+Status: Verified
Bug Type: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
New Comment:

Changing status to verified.


Previous Comments:
------------------------------------------------------------------------

[2005-09-23 15:59:02] marcot@php.net

We'll just leave it as a documentation issue. You *can* isolate the
session files between different instances by simply changing (for
example) the location of the session files using session.save_path in
your .htaccess file, or by writing your own custom handler.

------------------------------------------------------------------------

[2005-09-23 14:54:18] michael dot caplan at htc dot ca

Now that makes perfect sense! Should this be considered just a
documentation issue, or should PHP file based session support add an
additional feature to distinguish sessions from different hosts?

Thanks. Sorry for the bogus bug report.

------------------------------------------------------------------------

[2005-09-23 00:24:01] marcot@php.net

You mention that you have change session.gc_max_lifetime in an
..htaccess file. Does this mean that there are other areas of your site
/ other virtual hosts on the same machine that also use sessions? If
that's the case, it might be that the other instances are in fact
performing garbage collection because they take the master value from
php.ini--I don't think the session handler is capable of telling
whether a particular session file was created by a given instance of
the interpreter or not, and just cleans out everything it thinks has
expired.

------------------------------------------------------------------------

[2005-09-22 23:13:54] michael dot caplan at htc dot ca

Hi,

Here is the test case I put together:

<?php

session_start();

echo date('r');

echo '<hr />';

if (!session_is_registered('VAR')) {
echo 'No Session Var';
session_register('VAR');
$VAR = 'Session var set';
} else {
var_dump($VAR);
echo '<hr />';
echo session_id();
}

echo '<hr />';


// desplay environment settings
phpinfo();

?>


I would set the session in my browser and get session details (load the
page twice). I would then wait for 30+ minutes (my last case was around
1 hour). During this period, other users are hitting the site which
inits GC.

FYI, directory listing before:

$ ls -la /var/lib/php4/ | grep 3fb8f4a6e6e37ae1e378fbddbc5b4cc4
-rw------- 1 www-data www-data 27 Sep 22 14:25
sess_3fb8f4a6e6e37ae1e378fbddbc5b4cc4

And after

$ ls -la /var/lib/php4/ | grep 3fb8f4a6e6e37ae1e378fbddbc5b4cc4
nill


I also have the output of the phpinfo() before and after if you think
that would be of value.

------------------------------------------------------------------------

[2005-09-22 03:01:17] marcot@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

Can you send in a reproduce script that consistently exhibits this
behaviour? I can't reproduce this on my local system building from CVS.
With a script the devs can tell if the problem is really with the
session handling or with something else.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34588

--
Edit this bug report at http://bugs.php.net/?id=34588&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com