From:             developer at cartman34 dot fr
Operating system: Debian 7.1 (wheezy)
PHP version:      Irrelevant
Package:          Apache2 related
Bug Type:         Bug
Bug description:Deleting sessions without taking into account the configuration

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 bug report at https://bugs.php.net/bug.php?id=65301&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65301&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65301&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65301&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65301&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65301&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65301&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65301&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65301&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65301&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65301&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65301&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65301&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65301&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65301&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65301&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65301&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65301&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65301&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65301&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65301&r=mysqlcfg

Reply via email to