Bug #71038 [Ana]: session_start() returns TRUE on failure
Edit report at https://bugs.php.net/bug.php?id=71038&edit=1
ID: 71038
Updated by: yohgaki@php.net
Reported by: pfenderd at bellsouth dot net
Summary: session_start() returns TRUE on failure
Status: Analyzed
Type: Bug
Package: Session related
Operating System: Linux
PHP Version: 5.6.16
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
Return value of PHPAPI function is needed to be changed to fix this.
The fix will only be applied to next minor version at best. i.e. 7.1 or later.
Previous Comments:
------------------------------------------------------------------------
[2015-12-10 12:44:03] yohgaki@php.net
I have to change session internal functions (php_session_flush, php_session_save_current_state, etc)
so that they return SUCCESS/FAILURE. These functions are static and may be changed in released
versions. I'll modify these for 5.6/7.0. I have to look into save handler code more closely if
I can change without compatibility issues. I guess I can since current save handler has stricter
rules for return values.
------------------------------------------------------------------------
[2015-12-09 21:51:17] yohgaki@php.net
Sure.
------------------------------------------------------------------------
[2015-12-09 14:53:03] laruence@php.net
please have a look, it's a little weird s_open doesn't verify the path first..
------------------------------------------------------------------------
[2015-12-05 15:27:20] pfenderd at bellsouth dot net
Description:
------------
On a hosting server, the /tmp file system was mounted as read-only.
The function session_start() returned TRUE on failure to open a session file. It should have
returned FALSE.
There is a Warning message issued by PHP but it should have been an ERROR message.
Test script:
---------------
session_start();
session_write_close();
Expected result:
----------------
session_start needs to return FALSE on failure to open a session.
Actual result:
--------------
Warning: session_start(): open(/tmp/sess_99c3aa0ceeec362b9de4ece520aeef64, O_RDWR) failed: Read-only
file system (30) in /homepages/21/d361866886/htdocs/dayspeak_net/testlp.php on line 2
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started
at /homepages/21/d361866886/htdocs/dayspeak_net/testlp.php:2) in
/homepages/21/d361866886/htdocs/dayspeak_net/testlp.php on line 2
Warning: session_write_close(): open(/tmp/sess_99c3aa0ceeec362b9de4ece520aeef64, O_RDWR) failed:
Read-only file system (30) in /homepages/21/d361866886/htdocs/dayspeak_net/testlp.php on line 3
Warning: session_write_close(): Failed to write session data (files). Please verify that the current
setting of session.save_path is correct () in
/homepages/21/d361866886/htdocs/dayspeak_net/testlp.php on line 3
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71038&edit=1
Thread (10 messages)