Bug #65301 [Opn->Fbk]: Deleting sessions without taking into account the configuration
| From: | johannes@php.net | Date: | Sat, 20 Jul 2013 18:33:50 +0000 |
| Subject: | Bug #65301 [Opn->Fbk]: Deleting sessions without taking into account the configuration | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-180377@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65301&edit=1
ID: 65301
Updated by: johannes@php.net
Reported by: developer at cartman34 dot fr
Summary: Deleting sessions without taking into account the
configuration
-Status: Open
+Status: Feedback
Type: Bug
Package: Apache2 related
Operating System: Debian 7.1 (wheezy)
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.4-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
we can neither support debian builds nor old versions.
Previous Comments:
------------------------------------------------------------------------
[2013-07-20 08:13:08] developer at cartman34 dot fr
Description:
------------
I'am running a PHP5 5.4.4-14+deb7u3 with an apache2 2.2.22-13 and it suffered of an issue with
sessions, these ones are quickly deleted without taking into account the php.ini configuration.
I recently updated my server from Squeeze to Wheezy and i come with a new version of PHP, the
version 5.4 and these bugs.
I got the new php.ini configuration that i updated for my own preferences.
Here is my php.ini session related configuration:
[Session]
session.save_handler = files
;session.save_path = "/var/lib/php5"
session.use_cookies = 1
;session.cookie_secure =
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 604800
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 604800
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
;session.entropy_length = 32
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
You see that PHP should not delete sessions due to the session.gc_probability=0 and even if it does,
the session.gc_maxlifetime is for one week.
I checked the cookie, it is always right but the session file seems to disappear after the default
session.cookie_lifetime delay.
It is a debian stable server, so I can't upgrade PHP more than the current stable release for
debian. :-D
For my own usage, I will try to use a custom Session Handler.
Test script:
---------------
<?php
session_start();
if( !isset($_SESSION['last_time']) ) {
echo 'Creating session.';
} else {
echo 'Delay since last update: '.($_SESSION['last_time']-time()).'
seconds.';
}
$_SESSION['last_time'] = time();
// This is just a test script for bugs.php.net
Expected result:
----------------
Under one week reload, I expect displaying 'Delay since last update', not 'Creating
session.'.
Actual result:
--------------
Displaying 'Creating session.' after less than 30 minutes.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65301&edit=1