Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29561

Catchable fatal error: session_regenerate_id(): Failed to create(read) session ID: user (with PHP 7.0)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 2018.06.1
    • Fix Version/s: None
    • Component/s: Legacy stack
    • Labels:
    • Environment:

      Debian 9.5
      PHP 7.0.30-0+deb9u1
      Apache/2.4.25
      Percona 5.7.22-22

      Description

      Hello,

      I migrated from PHP 5.6 to 7.0 and I cann't connect to eZ Publish legacy with the handler ezpSessionHandlerDB:

      [Session]
      SessionNameHandler=custom
      Handler=ezpSessionHandlerDB
      

      Catchable fatal error: session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php/sessions) in /var/www/ez/lib/ezsession/classes/ezpsessionhandlerdb.php on line 158
       
      Call Stack
      #	Time	Memory	Function
      1	0.0001	363688	{main}( )
      2	0.0742	814040	ezpKernel->run( )
      3	0.0742	814040	ezpKernelWeb->run( )
      4	0.0902	1029032	ezpKernelWeb->dispatchLoop( )
      5	0.0979	1125008	eZModule->run( string(5), array(0), false, array(0) )
      6	0.0980	1126552	eZProcess::run( string(21), array(5), true )
      7	0.0980	1126592	eZProcess->runFile( array(5), string(21), true )
      8	0.0980	1130016	include( '/var/www/ez/kernel/user/login.php' )
      9	0.0984	1130992	eZUser::loginUser( string(5), string(9), ??? )
      10	0.2354	1219168	eZUser::loginSucceeded( object(eZUser)[34] )
      11	0.2418	1222952	eZUser::setCurrentlyLoggedInUser( object(eZUser)[34], string(2), ??? )
      12	0.2418	1222080	eZSession::regenerate( ??? )
      13	0.2418	1222080	ezpSessionHandlerDB->regenerate( true )
      14	0.2418	1222080	session_regenerate_id ( )
      

      The possible solution:
      Replace the return value of the function "read" from false to empty line:

      diff --git a/www/lib/ezsession/classes/ezpsessionhandlerdb.php b/www/lib/ezsession/classes/ezpsessionhandlerdb.php
      index 6d473e26e4..b2cd12487b 100644
      --- a/www/lib/ezsession/classes/ezpsessionhandlerdb.php
      +++ b/www/lib/ezsession/classes/ezpsessionhandlerdb.php
      @@ -77,7 +77,7 @@ class ezpSessionHandlerDB extends ezpSessionHandler
               }
               else
               {
      -            return false;
      +            return '';
               }
           }
      

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Gorobchenko Eugene
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: