PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Probably because the developer didn't know that session data is serialized automatically. Generally.
To the broader question, PHP can't store an object in a file (where sessions are normally stored) or a database (the second-most common place) - there's too much stuff in memory. So it serializes the object, which involves storing the name of the class and the values of the member variables. Later it unserializes the object by setting up a new object and filling in the variables.