In my System I'm using an Object User
to store all the needed UserData which I get from the Database.
In the Session I'm storing the User ID. On Page call I query the User Data from the DB and store it into the User
-Object.
Now I saw somebody storing all the User
-Object into the Session.
I wondered what's the better way?
I saw this Post here on SO, which helped a bit.
But 2 Things:
To lower the risk of Session-Hijacking I'm creating a new Session on every Page Load. Therefore all the Data from the Session Object gets transferred.
Somewhere else I saw that PHP 5 has an Cache already in the Pack. So Does it automatically store the User Object?