Bug #77588 [Opn]: Session started with read_and_close creates empty session

From: Date: Fri, 08 Feb 2019 13:53:07 +0000
Subject: Bug #77588 [Opn]: Session started with read_and_close creates empty session
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219443@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 User updated by: piotr at halas dot net dot pl Reported by: piotr at halas dot net dot pl Summary: Session started with read_and_close creates empty session Status: Open Type: Bug Package: Session related Operating System: Linux PHP Version: 7.2.15 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2019-02-08 13:44:54] spam2 at rhsoft dot net what does the ini_set here and are you aware that it is not supposed to init a new session but resume one readonly to watch for example status of file uploads ------------------------------------------------------------------------ [2019-02-08 13:38:58] piotr at halas dot net dot pl Description: ------------ I don't know if this is a bug, but when starting a session with read_and_close options enabled PHP creates an empty session if no session was found. Test script: --------------- <?php ini_set('session.save_path', getcwd()); session_start(['read_and_close' => true]); echo "Sessions: ".count(glob(getcwd().'/sess_*')).PHP_EOL; Expected result: ---------------- Sessions: 0 Actual result: -------------- Sessions: 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77588&edit=1

« previous php.bugs (#219443) next »