So I experienced this after migrating from Lighttpd webserver, PHP 5.6 to Nginx webserver, PHP 7.2, and at first it seamed so random, however, I was able to notice that this issue is user specific, where some of the users where able to login normally, but the server was not able to provide data from the session, so I checked read
function in the custom session class and checked what data it was trying to serialize()
and return, by using unset()
I removed anything that I thought was not useful for the application to run before serialize()
and return, and that seams to have solved the problem.
So the problem is either one or both:
- too much data as @Luke Wenke suggested
- data that cannot be handled as @Carl suggested
for more on the read
function: https://www.php.net/manual/en/function.session-set-save-handler.php