Discussion on Cookie Handler


BastianHofmann supports this item


8 comments found.


Is it recommended to modify Secret key in Encrypter.php file ?



Yes, very much so.


Is it possible to build a array?

I currently use the sessions:
$_SESSION['cart'][$product_id] = $quantity;
foreach($_SESSION['cart'] as $product_id => $quantity):

Do you think that I can do something of similar with your script?

Thanks again!


Ok, I use serialize. Thanks !

You can `Cookie::set()` an array, but you have to `serialize($array)` it before and `unserialize($array)` after you `Cookie::get()` the array.

$cart = array();
$cart[$product_id] = $quantity;
$cart = serialize($cart);
Cookie::set('cart', $cart);
$cart = Cookie::get('cart');
$cart = unserialize($cart);
foreach($cart as $product_id => $quantity) :

Will update when I have the time, to make this easier.

Will update when I have the time, to make this easier.

Thanks again!

QUOTE (from documentation)
I could not find a more advanced cookie handler.

Indeed, I vouch for the author’s statement. By far the best and most comprehensive Cookie management script I have ever found, worth more than its weight in gold.

Many thanks. I’d have been happier if the Event handler class coming with this hadn’t been abridged. :bigsmile:

Fine package, the more I use it the better I like it! With array “serialize” it will be complete and the update will be welcome. I am acquiring the Event Handler package too, if this script is the yardstick. This author is inimitable.

Thanks for those kind words! The update for serialized values is on the way. You will then be able to store all data types(string, bool, array, object …) as a cookie.

That would make this the best Cookie Management Script ever. I bought the Event Handler package less than an hour ago and find it to be equally awesome! Much obliged.

I nee this to create a special search. 1. user clik a map and get a state for ex : “my state” 2. if if I click a link after, may I get page.php?state=mystate ? and how ?

Thank you

I need a very simple cookie use, but is better to ask before:

  • Read if xxx cookie exists
  • If exist redirect to homepage
  • If not exists redirect to another page with site rules. 2 buttons will be available there: I agreee – I don’t agree
  • If agree save a cookie xxx which will be valid for a year and then redirect to homepage.

The plugin allows you to read if cookies exist and set cookies. For redirecting you can use php:

header(“Location:"); die();

Does this code helps me to analyze web site and list cookies in it??

Hi Preview is disabled …