For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > September 2006 > Prado: Set and load cookies









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Prado: Set and load cookies
Albert Peschar

2006-09-29, 7:57 am

Note: This message is about the Prado framework, if you don't know what
it is you most certainly can't answer my question.

Hi,

I have this code:

$cookies = $this->Response->getCookies();
$cookie = new THttpCookie("RememberLogin", $login_data);
$cookies[] = $cookie;

Do I need to call some kind of "load" method, before loading a cookie
in
another request? Because I have this in my OnPreRender():

$cookies = $this->Response->getCookies();
$cookie =
this->Response->getCookies()->findCookieByName("RememberLogin");
var_dump($cookie);

If I run the request that creates the cookie in the same request I get
the cookie data, but if I then refresh the page without setting the
cookie it says:

NULL

Regards,
Albert Peschar

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com