Bug #70871 [Com]: session_regenerate_id(): Failed to create session ID: user (path: )

From: Date: Fri, 13 Nov 2015 10:18:49 +0000
Subject: Bug #70871 [Com]: session_regenerate_id(): Failed to create session ID: user (path: )
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197222@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70871&edit=1

 ID:                 70871
 Comment by:         narf at devilix dot net
 Reported by:        jacky at xsteach dot com
 Summary:            session_regenerate_id(): Failed to create session
                     ID: user (path: )
 Status:             Assigned
 Type:               Bug
 Package:            Session related
 Operating System:   mac os x
 PHP Version:        7.0.0RC6
 Assigned To:        yohgaki
 Block user comment: N
 Private report:     N

 New Comment:

@yasuo

Yep, that's the session handler in question.
I guess I'll have to wait for your error messages patch ...


Previous Comments:
------------------------------------------------------------------------
[2015-11-13 05:23:28] bellosthomas at gmail dot com

I was also getting a fatal error (check comment above), with a custom session handler. After
yohgaki's comment about the return value of the read() method, which needs to return a string,
I checked my session handler and I saw I was returning boolean false in some cases. Casting the
return value to string, solved it.

------------------------------------------------------------------------
[2015-11-13 01:20:26] yohgaki@php.net

Oops, you are getting other kind of error.

session_regenerate_id(): Failed to create session ID: user (path: <value of
session.save_path>)

This error is raised by multiple reasons. The error messages are better to modify so that users can
distinguish the cause. Anyway, it may be raised if

 - new session ID creation is failed. (Very unlikely)
 - opening save handler is failed.
 - session ID collision is detected and failed. (Very unlikely)
 - session read with new session ID is failed.

I'll modify error messages to distinguish the cause of your problem.

------------------------------------------------------------------------
[2015-11-13 00:44:36] yohgaki@php.net

@narf

Is this the save handler?

https://github.com/bcit-ci/CodeIgniter/blob/develop/system/libraries/Session/drivers/Session_redis_driver.php#L162

I haven't looked into detail and don't understand the handler fully, but this function may
be the cause of bug. 

Returning FALSE on read will raise the error.

------------------------------------------------------------------------
[2015-11-13 00:39:33] yohgaki@php.net

@narf

OK. Could tell me where I can look at the save handler code?

------------------------------------------------------------------------
[2015-11-12 18:00:05] narf at devilix dot net

@yasuo

I didn't say that session_start() issues that message.

What I'm saying is that calling session_regenerate_id() *immediately after* session_start(),
would issue this:

session_regenerate_id(): Failed to create session ID: user (path: <value of
session.save_path>)

And I'm kind of proxy-ing a bug report that was submitted to me here: https://github.com/bcit-ci/CodeIgniter/issues/4230

------------------------------------------------------------------------


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=70871


--
Edit this bug report at https://bugs.php.net/bug.php?id=70871&edit=1


Thread (15 messages)

« previous php.bugs (#197222) next »