Skip to content

Session Handling Errors in PHP 7 using DB driver #2827

@anaxmedia

Description

@anaxmedia

Recently upgraded my M2 sample site to PHP 7 to do some performance benchmarking and I'm running into the following issue when trying to do anything session related (admin login, checkout, account functions, etc).

I use Redis backend for cache and Memcache for php session cache.

Getting the following error in Magento 2 on PHP 7.0.1:

session_regenerate_id(): Failed to create(read) session ID: user (path: aws-memcache-instance:11211) in /var/www/mysite.com/html/vendor/magento/framework/Session/SessionManager.php on line 473

Same issue with CM Redis and another M2 extension:

Inchoo/Inchoo_PHP7#4
colinmollenhour/Cm_RedisSession#70

It appears to be an issue with the read function not always returning a string.

As a temporary fix I cast the return value for the read() function in the SessionHandler as a string.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions