[eluser]jedd[/eluser]
[quote author="ckeller" date="1248807746"]The reason I do things this way is because I do have other data stored in the session pertinent to the app sometimes.[/quote]
Well, in general, stuff in session data should be dependent on the user - otherwise it's a bit of a waste.
Can you give some examples of stuff that's unrelated to the user, but tied to the app only?
Quote:However, I also want the flexibility to either reload the entire user array from the user table (such as if they logged in), and if I ever needed to unset just that user info, I could just unset that array and not lose what else is in the other session variables.
You mean you serialise $_SESSION['user'] and store that in the database?
So any time a user changes a configuration setting, it doesn't update the database until they log out, and even then it only updates the internals of a single large array rather than a column in a table - is that what you're saying?
WRT 'unset just that user info' - what
other user's info exists in
that user's session, can I ask?
Quote:What did you mean with this question? "Have you considered just pulling session data out of the 2D array?"
I mean adopt a flatter approach to the session data. Rather than $_SESSION['user']['is_admin'] - just use $_SESSION['is_admin'], for example.