every time you reload page, this variable in class is set to array() (always starts empty), them you set one value to it and save to session, when you reload second page, you need to set from session first, then add new value and all save again back to session...understand ? :) -- Lep pozdrav, Tilen Majerle http://majerle.eu
2012/2/26 heohni <[email protected]> > it makes no diff if I do it from model or from controller > > On 26 Feb., 18:53, Tilen Majerle <[email protected]> wrote: > > where you read data from session ? :) > > -- > > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > > > 2012/2/26 heohni <[email protected]> > > > > > > > > > > > > > > > > > Hi, > > > > > in one my models I declare > > > var $deletedEia = array(); > > > > > later on, I add data to the array > > > > > $this->deletedEia[] = array_pop($array); > > > > > then I do want to save it to a session: > > > CakeSession::write('deletedEia', $this->deletedEia); > > > > > Strange enough, on every load of this function, the first array > > > element gets overwritten and not as I expected it added. > > > > > I was expecting, if I call 5 times this function (5 times page reload) > > > this array would have 5 entries... > > > But this is not the case, it has always only 1 entry at the time and I > > > don't see why.... > > > > > What could be the problem? > > > > > -- > > > Our newest site for the community: CakePHP Video Tutorials > > >http://tv.cakephp.org > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > > others with their CakePHP related questions. > > > > > To unsubscribe from this group, send email to > > > [email protected] For more options, visit this > group > > > athttp://groups.google.com/group/cake-php > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
