Edit report at https://bugs.php.net/bug.php?id=16263&edit=1
ID: 16263
Comment by: webmaster33 at gmail dot com
Reported by: kur at natur dot cuni dot cz
Summary: session.start() create new empty session file and
not resume existing session
Status: No Feedback
Type: Bug
Package: Session related
Operating System: ANY
PHP Version: 4.3.0-dev
Block user comment: N
Private report: N
New Comment:
I have the same problem.
System:
Linux 2.6.26-2-686 #1 SMP Sat Jun 11 14:54:10 UTC 2011 i686
PHP 5.3.3-7+squeeze1 with Suhosin-Patch (cli) (built: Mar 18 2011 17:22:52)
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Problem:
One PHP script creates a session (474 bytes), which I want to read with another
PHP script.
The second script starts like this:
<?php
session_start();
var_dump( session_name() . "=" . $_COOKIE['PHPSESSID'], "<br>\n" );
var_dump($_SESSION, "<br>\n");
...
The problem is, that when I start second script, the 474 bytes of the session
is emptied to 0 bytes.
The the domain of first and second script are different, but they are on the
same virtual hosted server, and they use the same session path: /var/lib/php5
/etc/php5/apache2/php.ini session settings are:
[Session]
session.save_handler = files
session.save_path = /var/lib/php5
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
Any ideas?
Previous Comments:
------------------------------------------------------------------------
[2011-08-16 13:02:02] phpbugs at aron dot ws
If you run out of space you get the same effect :D
------------------------------------------------------------------------
[2010-09-23 22:21:55] sartorato at gmail dot com
Hi there,
I was having the same problem with PHP creating session files with 0Kb.
I solved putting the <? session_start();?> on the first line of the php file.
After this it works like a charm.
Hope it helps somebody.
Ricardo Sartorato
------------------------------------------------------------------------
[2009-12-16 20:07:04] sven dot holcombe at gmail dot com
Running on default XAMPP installation, with the
session.save_path = "C:\xampplite\tmp"
When I set the apache document root to be:
<Directory "C:/xampplite/htdocs">
And then run a file with contents:
<?PHP session_start(); ?>
There is a session file created. Ie, normal operation.
When I set the apache document root to be:
<Directory "S:/htdocs">
And then run THE SAME file with contents:
<?PHP session_start(); ?>
A 0KB session file is created. Ie, it is empty, and I cannot access session
variables.
Please help.
------------------------------------------------------------------------
[2009-12-02 18:57:14] john at 5070 dot info
The same issue.
# php-cgi -v
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Apr 26 2009
22:11:16)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by
eAccelerator
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend
Technologies
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
System call trace (in fact, this is processed by mod_php of the same version):
open(".../sess_a6549.............", O_RDWR|O_CREAT|O_LARGEFILE, 0600) = 1035
fstat64(1035, {st_mode=S_IFREG|0600, st_size=96, ...}) = 0
flock(1035, LOCK_EX) = 0
fcntl64(1035, F_SETFD, FD_CLOEXEC) = 0
fstat64(1035, {st_mode=S_IFREG|0600, st_size=96, ...}) = 0
_llseek(1035, 0, [0], SEEK_SET) = 0
read(1035, "Acess|s:1:\"1\";id|s:3:\"108\";login|"..., 96) = 96
...
ftruncate64(1035, 0) = 0
_llseek(1035, 0, [0], SEEK_SET) = 0
write(1035, ""..., 0) = 0
close(1035) = 0
Session files are shared via NFSv4, if it is important.
------------------------------------------------------------------------
[2009-08-26 18:00:41] chris dot kerrison at farrendale dot co dot uk
Hello, I have theis session problem, tried everything on this page not still
wont work. Is anyone else having the problem still??
I have 2 servers, one it works fine on and the other it fails, they use the
same settings, and have tried differant versions, yet it still fails on the 2nd
server.
Ho many people here are running it on a server with a " _ " in the computer
name? that to me seems the only thing differant between the computers with my
setup.
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=16263
--
Edit this bug report at https://bugs.php.net/bug.php?id=16263&edit=1