Re: Newbie Sessions ?

2007-07-06 Thread r557

Well how is it done then in a shopping cart situation where you need a
collection of items?

On Jul 5, 10:06 pm, citrus [EMAIL PROTECTED] wrote:
 When you add values to the session, the old one will be overwritten
 (if exists)

 On Jul 6, 6:35 am, r557 [EMAIL PROTECTED] wrote:

  Creating a Shopping Cart, and am wondering if when you add values to a
  session, does it overwrite the current contents in the session?

  For example:

  $this-Session-write('ShoppingCart.id', $id);
  $this-Session-write('ShoppingCart.name', $name);
  $this-Session-write('ShoppingCart.virtual', $virtual);
  $this-Session-write('ShoppingCart.price', $price);

  Having this code, if the first time i passed an $id of 4, then next
  time i added an $id of 6, will 6 overwrite 4 or will be added as
  another row in the session?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie Sessions ?

2007-07-06 Thread Sergei

Just store an array in the session variable. When you need to add
item, read array, add, and save it again.


On 6 июл, 18:51, r557 [EMAIL PROTECTED] wrote:
 Well how is it done then in a shopping cart situation where you need a
 collection of items?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Newbie Sessions ?

2007-07-05 Thread r557

Creating a Shopping Cart, and am wondering if when you add values to a
session, does it overwrite the current contents in the session?

For example:

$this-Session-write('ShoppingCart.id', $id);
$this-Session-write('ShoppingCart.name', $name);
$this-Session-write('ShoppingCart.virtual', $virtual);
$this-Session-write('ShoppingCart.price', $price);


Having this code, if the first time i passed an $id of 4, then next
time i added an $id of 6, will 6 overwrite 4 or will be added as
another row in the session?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie Sessions ?

2007-07-05 Thread citrus

When you add values to the session, the old one will be overwritten
(if exists)

On Jul 6, 6:35 am, r557 [EMAIL PROTECTED] wrote:
 Creating a Shopping Cart, and am wondering if when you add values to a
 session, does it overwrite the current contents in the session?

 For example:

 $this-Session-write('ShoppingCart.id', $id);
 $this-Session-write('ShoppingCart.name', $name);
 $this-Session-write('ShoppingCart.virtual', $virtual);
 $this-Session-write('ShoppingCart.price', $price);

 Having this code, if the first time i passed an $id of 4, then next
 time i added an $id of 6, will 6 overwrite 4 or will be added as
 another row in the session?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---