pashanoid has asked for the wisdom of the Perl Monks concerning the following question:

Dear Brethern, what's the propper way of storing shopping cart items in Apache::Session? should I encode the orders in one hash like:

$session{'cart'}='item_1=quantity:item_2=quantity:...';

encode/decode it every time the user adds/deletes items from his cart and pass it around or is there a better/propper wat to do this? Thank you!

Replies are listed 'Best First'.
Re: Storing shopping cart orders via Apache::Session
by Anonymous Monk on Aug 23, 2012 at 06:28 UTC
    store an array instead -- just like the documentation shows
    $session{an_array_ref} = [ $one, $two, $three ];
      any chance you can provide an exaple?
        I just did. You can find additional examples in MANIFEST (hint, its t/99file.t)