Richard Heyes wrote:
Because it's not user data, it's server data.

So? It's there - use it.

So are cookies, would you stuff this into a cookie? No, because that's not what cookies are there for.

"Because it's there" is never a good reason to do something.

That's entirely the wrong place to
store something like which database API is installed.

Not really. You could even wrap a function called (for example) Feature() around it.

Yeah, really. Sessions are for user data. If it's the same for all users then it doesn't belong in the session, it belongs in a server-wide cache.


Sessions are for whatever you choose to put in them. And why implement a cache when you've got something perfectly usable (sessions) already?

You could potentially be pointlessly duplicating that data hundreds or thousands of times depending on how busy your site is. Also, in this particular example there is no need to cache that information beyond the request level because asking PHP for it is not an expensive operation, or at the very least is no more expensive than maintaining it in a session.

One other thing to note is that putting it in the session will survive a rebuild of PHP to add/remove modules and a restart of the web server. It's probably not likely to happen but that could seriously break your application.

However this is just my opinion. You're free to implement your application in whatever way you choose.

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to