Howdy,
Thought I'd throw this out to the mailing list - so I can keep track
of responses.
I'm currently caching pages that have a welcome message. A flag
whether or not to display the welcome messages are set in a cookie. I
also have a caching rule which checks the cookie. All's cool with JS
users as js can set the cookie for me, without its more of a pain - I
pass a GET variable which tells me I need to set the cookie!
When using caching the initialize for the Action and the View are
called - so I can process the GET var there!! But the Action
initialize is a lame duck as there is no access to $rd it comes back
null.. so I'm using the View which is dandy.
However, when I do this:
<code>
$res = $this->getResponse();
$res->setCookie('hide_welcome_message', true, 60*60*24*14);
$res->setRedirect($url);
$this->clearLayers();
return;
</code>
It don't work! Is there a reason I can't set the cookie for the response?
I have managed it by doing this:
<code>
setcookie('hide_welcome_message', true, time() + 60*60*24*14);
header('Location: '.$url);
die();
</code>
Which ain't the agavi way! :-/
_______________________________________________
Agavi Dev Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/dev