Re: note 90623 deleted from function.setcookie by thiago

From: Date: Fri, 01 May 2009 18:54:49 +0000
Subject: Re: note 90623 deleted from function.setcookie by thiago
References: 1 2  Groups: php.notes 
Request: Send a blank email to php-notes+get-154083@lists.php.net to get a copy of this message
Actually, I had looked at this one yesterday and opted to keep it. I'm going to replace it on the page for now, pending your response with a reason for it not being kept there. My thought is that it's useful, and the poster was correct in placing it on a third-party site: it's not an attempt to drive traffic to their own site/blog/whatever, but yet it's off of our site so as not to take up too much real estate. On Thu, Apr 30, 2009 at 22:17, <thiago@php.net> wrote: > Note Submitter: kyle [dot] florence [@t] gmail [dot] com > > ---- > > Here is a static Cookie wrapper class that you may find helpful: > http://pastebin.com/f10a7bcba > > Example usage: > > <?php > // Basic usage > Cookie::set('testcookie', 'test'); > print(Cookie::get('testcookie')); > > // You can set 'array' cookies in two different ways: > Cookie::set('array[one]', 'item one'); > Cookie::set(array('array' => 'two'), 'item two'); > > // Likewise, you can also get 'array' cookies in two different ways: > print(Cookie::get('array[one]')); > print(Cookie::get(array('array' => 'one'))); > > // Or you can grab the whole array at once: > print_r(Cookie::get('array')); > > // Deleting cookies is done in the same way: > Cookie::del('array[one]'); > Cookie::del(array('array' => 'two')); > > // Delete the entire array: > Cookie::del('array'); > > // Print contents of $_COOKIE (refresh for this) > print '<pre>'; > print_r(Cookie::contents()); > print '<pre>'; > ?> > > -- > PHP Notes Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- </Daniel P. Brown> daniel.brown@parasane.net || danbrown@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000

« previous php.notes (#154083) next »