php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65301 Deleting sessions without taking into account the configuration
Submitted: 2013-07-20 08:13 UTC Modified: 2013-10-15 11:54 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: developer at cartman34 dot fr Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: Irrelevant OS: Debian 7.1 (wheezy)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: developer at cartman34 dot fr
New email:
PHP Version: OS:

 

 [2013-07-20 08:13 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-20 18:33 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2013-07-20 18:33 UTC] johannes@php.net
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.
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 22:01:28 2024 UTC