2010年1月29日星期五

Re: [fw-mvc] FlashMessenger namespace not expiring when user is logged in

Hello!

So you can see the progression, here are several var_dump()s of $_SESSION at
various times during the process.

On first visiting the login page:
array(0) {
}

When the login form is submitted, the credentials are processed; if
successful, the user is redirected to the site home page. At that point,
the FlashMessage from the processing step is displayed, and $_SESSION looks
like this:
array(1) {
["Zend_Auth"]=> array(/* stored auth info */)
}

On visiting another page right after that, the FlashMessage is still
displayed, and $_SESSION still looks like this.
array(1) {
["Zend_Auth"]=> array(/* stored auth info */)
}

All this is sort of odd to me, as I'd expected $_SESSION to contain some
evidence of the FlashMessage values; they _are_ being displayed at the
proper time.

As far as the call to getMessages() goes, I'm doing that in my layout
script. Here's the full code:

[code]
if (!is_array($this->messages)) {
$this->messages = array();
}
$this->messages = array_merge(
$this->messages,

Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages()
);
if (count($this->messages) > 0) {
echo $this->htmlList($this->messages, false, array('class' =>
'messages'));
}
[/code]

Thanks!
Adam
--
View this message in context: http://n4.nabble.com/FlashMessenger-namespace-not-expiring-when-user-is-logged-in-tp970072p1456444.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: