I've been doing some reading and I've seen a lot of people stating that you must serialize an object before storing it in a session.

Code PHP:
$_SESSION['userData'] = serialize($user);

I've found it difficult to find supporting documentation though. Why do we need to serialize before storing the object in a session?


Should these perhaps be avoided due to possible performance issues?