Max Session Variables

From a practical perspective, at what point do you get in trouble with session variables regarding memory and performance? And I understand there are probably many variables to this, but is it 10, 50, 100, 500 …?

I would like to carry a session array to increase performance, reduce database traffic, etc. and am not sure how large I can safely make that.

Any takers on the morals? Pretty funny.

And thanks for the input. I understand what you mean about info variables vs storing text. Good point.

Session data is stored in a session file on the server.
The variable $_SESSION is used as an array, and is stored in the session file as a serialized array.
That means that when you call session_start(), the session file is read into the memory and is unserialized after the entire file is read.
So, the limit of the session’s file size equals the maximum allowed memory.

Note that the size of serialized data is not the same as the size of unserialized data in memory.

You can store 500 and more variables in a session without a problem.
But, you should only store the data you need in a session file, e.g. a user hash, an order-by variable, … stuff like that.
Storing entire texts in a session file should be considered bad practice.