Hi Leigh, On Thu, Jul 7, 2016 at 5:25 PM, Leigh <lei...@gmail.com> wrote: > On 6 July 2016 at 22:30, Yasuo Ohgaki <yohg...@ohgaki.net> wrote: >> php_session_create_id() may return NULL. It's an usual error. Session >> module supports session ID creation save handler which may return >> anything valid for the type. >> >> Session module tries to call php_session_create_id() several >> places/times. If it could not get valid one, it raises >> E_RECOVERABLE_ERROR or E_ERROR eventually. >> >> Although it's not enabled yet, PHP_FUNCTION(session_create_id) returns >> FALSE it fails. > > If it fails due to a lack of random, it throws a fatal. Tested your PR > and forced the fd of /dev/urandom to -1 in ext/standard/random.c > > $ sapi/cli/php -n -r 'session_start();' > > Next Exception: Cannot open source device in Command line code:1 > Stack trace: > #0 Command line code(1): session_start() > #1 {main} > thrown in Command line code on line 1 > > Fatal error: session_start(): Failed to create session ID: files > (path: ) in Command line code on line 1
session_start() will result in E_ERROR or E_RECOVERABLE_ERROR currently. I've tried to change E_ERROR to E_RECOVERABLE_ERROR before, but it was reverted because someone objected. session_create_id() which is disabled by #define returns FALSE now. I need RFC vote to enable session_create_id(). It was added as FR implementation, but it is disabled for the same reason above. There are many places need cleanup. Regards, -- Yasuo Ohgaki yohg...@ohgaki.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php