Session destroyed out of nowhere in PHP

radioaktiv picture radioaktiv · Jan 22, 2016 · Viewed 8.4k times · Source

I am experiencing issue with a session being destroyed out of nowhere:

session_start(): Failed to decode session object. Session has been destroyed.

Kind of impossible to replicate the issue since I got this thrown in my server log.

Any ideas what could be the roots of that problem and/or where to start because I am getting that very rare (almost never).

Answer

Luke Wenke picture Luke Wenke · Jul 11, 2017

This happened to me when I was storing too much in $_SESSION where they were saved using serialize() in a table. Solution: don't store too much.