Cache data in PHP SESSION, or query from db each time?
Is it "better" (more efficient, faster, more secure, etc) to (A) cache data that is used on every page load in the $_SESSION array (but still querying a table for a flag to reload the data fresh), or (B) to load it from the database each time? I'm using the cache method (A), but I'm worried that with hundreds of users, memory could become an issue? It's just simple data, like firstname, lastname, birthday, etc. With either method, there's still a query being run. Thoughts? If your data is used on every pages, and is the same for all users, I wouldn't cache it in $_SESSION (which means having a