Bug #77588 [Fbk->NoF]: Session started with read_and_close creates empty session
| From: | php-bugs at lists dot php dot net | Date: | Sun, 17 Feb 2019 04:22:05 +0000 |
| Subject: | Bug #77588 [Fbk->NoF]: Session started with read_and_close creates empty session | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219607@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77588&edit=1
ID: 77588
Updated by: php-bugs@lists.php.net
Reported by: piotr at halas dot net dot pl
Summary: Session started with read_and_close creates empty
session
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Session related
Operating System: Linux
PHP Version: 7.2.15
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2019-02-09 00:43:16] yohgaki@php.net
The same result with current master as expected.
[yohgaki@dev PHP-master]$ ./sapi/cli/php -v
PHP 8.0.0-dev (cli) (built: Feb 9 2019 09:39:31) ( NTS DEBUG )
------------------------------------------------------------------------
[2019-02-09 00:40:48] yohgaki@php.net
I got this result from my Fedora's PHP 7.2.14.
Are you using "files" save handler? I guess not.
It looks like I have to document "save handler" authors must create session data (and lock
it) upon read when data does not exist yet.
------------------
[yohgaki@dev PHP-master]$ php -v
PHP 7.2.14 (cli) (built: Jan 8 2019 09:59:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.14, Copyright (c) 1999-2018, by Zend Technologies
[yohgaki@dev PHP-master]$ php
<?php
ini_set('session.save_path', getcwd());
session_start(['read_and_close' => true]);
echo "Sessions: ".count(glob(getcwd().'/sess_*')).PHP_EOL;
Sessions: 1
------------------------------------------------------------------------
[2019-02-08 14:14:07] sjon at hortensius dot net
I don't think this is a bug - all read_and_close does is "result in the session being
closed immediately after being read"
so it doesn't influence session_start from creating an empty session like it always does - see
https://3v4l.org/fLnNI
------------------------------------------------------------------------
[2019-02-08 14:02:06] spam2 at rhsoft dot net
hell you use a readonly option and ask why it don't write...
------------------------------------------------------------------------
[2019-02-08 13:53:07] piotr at halas dot net dot pl
Ini_set is only for test purpose.
The problem is that session_start(['read_and_close' => true]) creates new empty session
file if no session file is found. This happens also with memcached save_handler.
------------------------------------------------------------------------
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=77588
--
Edit this bug report at https://bugs.php.net/bug.php?id=77588&edit=1