Hi there,

I'm using the built in Cookies component to read, write and save my
Cookies in my app.  I declare my cookies in my app_controller.php in
the beforeFilter method as follows:

function beforeFilter(){
        $this->Cookie->name      = 'myCookie';
        $this->Cookie->key         = 'mykey';
        $this->Cookie->domain   = 'mydomain.com';
        $this->Cookie->secure    = false;
        $this->Cookie->path        = '/md/prefs';
}

In my Users controller -> Login method I write my cookie values:

function login() {
//onSuccess of Login:
$this->Cookie->write('uid', $user['User']['id'], false, '+1 day');
$this->Cookie->write('key',$user['User']['key'], false, '+1 day');
$this->flash('Logged in', '/users/home');
}

I var_dump($this->Cookie) on the login method and everyting seems to
be correct, the cookie is named 'myCookie' and the values are
present.  But, once I redirect to the '/users/home' page the cookie is
reset to the default 'CakeCookie' and no values are present.  Any
ideas on why this would occur, when is the cookie really
instantiated?  Should I take the code out of the beforeFilter?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to