Re: native vs. phplib sessions
| From: | Brad Pauly | Date: | Mon, 07 Apr 2003 17:30:03 +0000 |
| Subject: | Re: native vs. phplib sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142726@lists.php.net to get a copy of this message | ||
John W. Holmes wrote:
Whether your class operates on the $_SESSION array or your own array, what's the difference? I don't see a benefit here.I agree that that is the same. I would actually prefer a method that operates on the data. For example, if you store the backgroud color of your site in a session variable and you want to change it, you don't have to include a file to make sure the function that sets it is available. This is really just a preference.
http://www.php.net/manual/en/function.session-write-close.php I'll admit that before $_SESSION came along, sessions were a pain. All you do is call session_start() and then use $_SESSION like any other variable and it's contents will be available on any page with session_start(). How much easier can it be?Hehe. I even looked before I replied, I swear, apparently not very well though. This doesn't account for a situation in which you have modified a session and you don't want to save it. Anyway, I agree that the built in sessions are excellent. I am not stating that one is better or easier than the other, just that I think there are situations where you might want to roll your own. Brad