Re: Sessions
| From: | Stut | Date: | Mon, 15 Sep 2008 17:17:02 +0000 |
| Subject: | Re: Sessions | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280199@lists.php.net to get a copy of this message | ||
On 15 Sep 2008, at 17:52, Jim Lucas wrote:
Stut wrote:Indeed, that was pretty messed up. That's what happens when you edit code in WordPress. Thanks for the heads up, I've updated the post.On 15 Sep 2008, at 16:20, Thodoris wrote:Stut, I have a question about your Read() method. You are initializing a variable called $retval, but then doing nothing with it. Then you are returning the result handler whether is it a db handle or a result set. Also, you are running mysql_free_result on that result variable before returning it.http://stut.net/blog/2008/07/20/mysql-sessions/ -StutAlso just to throw this out, you can also use the session_set_save_handler function. This will let you store your sessions wherever you see fit. file system, database, etc. Comes in handy when you're on multiple web servers. http://us2.php.net/session_set_save_handlerLiving to learn every single day. Although I find this feature very useful (storing session data in a database for e.g. mysql) I didn't find any good example in the manual or anywhere near using it. Can anyone enlighten me on this ?
Plus, what does the ampersand before the method name do for you?It tells the function to return a reference. Session data can be pretty big so on older versions of PHP this can save a fair amount of memory. With CoW now in place in later versions it has no effect at all but I've left it it for compatibility. -Stut -- http://stut.net/