Cookie are related to controller method ?
I ask this because  if I send a cookie in a controller

class generic Controller extends AppController
{
     function add_cookie()
     {
         if(!$_COOKIE['Hi'])
          {
               setcookie('Hi','true',2147483647);
               echo "Cookie sended!"
          }
     }

     function foo()
     {

     }

     function afterFilter()
     {
         print_r($_COOKIE);
     }
}

generic::add_cookie() output ( First time):
Cookie sended!
Array ([myapp] => 3f4c5c0168f632e8084a74957efce6c4 )

generic::add_cookie() output ( with cookie sended):
Array ( [Hi] => true [myapp] => 3f4c5c0168f632e8084a74957efce6c4 )

Ok, the cookie is sended

generic::foo() output:
Array ( [myapp] => 3f4c5c0168f632e8084a74957efce6c4 )

Hei where is my cookie ?

Now it's too late for workink on (i 'll do it tomorrow : P )
My question is: are $_COOKIE redifened in some class everytime i called
a page?

Cake version is 1.1.5.3148


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to