Before you criticise, are you sure that you read and tried what it
said in the docs?
Example given in the docs is:
$this->Cookie->write('last_name', 'Masters', false, '1 hour');
Therefore you should be able to do this:
$this->Cookie->write('cart', array(124,1232,3232), false, '1 hour');
>From your question, it does not seem that you tried that code.
However, if you really did find a 'better way', please make a
comment in the docs to help the next guy.
Best wishes.
On Sep 20, 2:05 pm, Kenchu <[EMAIL PROTECTED]> wrote:
> Thanks! Works perfect now. Though I think it's bad they dont say this
> in the documentation.
>
> On Sep 20, 11:42 am, "Yodi Aditya" <[EMAIL PROTECTED]> wrote:
>
> > Try using :
> > function beforeFilter() {
> > $this->Cookie->time = '5 Days';
> > $this->Cookie->path = '/';
>
> > }
>
> > On 9/20/08, Kenchu <[EMAIL PROTECTED]> wrote:
>
> > > I've managed to get cookies working for the session, but if I restart
> > > my browser, the cookies seem to be gone, and $cookieTime doesn't seem
> > > to do anything about it. This is the code I've got:
>
> > > _______________________________________________
>
> > > [...]
>
> > > var $cookieName = 'my.cookie';
> > > var $cookieTime = 3600;
> > > var $cookieKey = '***************************';
>
> > > function index() {
> > > // $this->Cookie->write('cart', array(124,1232,3232));
> > > pr($this->Cookie->read('cart'));
> > > }
>
> > > [...]
>
> > > _______________________________________________
>
> > > So what I do is uncomment the cookie-write-line, run the script, then
> > > comment the line again, and then run the script once more. Now if you
> > > DONT turn off the browser, you will see the array being printed.
> > > However, if I restart the page and visit it again, nothing will be
> > > printed.
>
> > > Help plz. :D
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---