I have a function in the main Controller that does this:
public function delayMessage($msgText)
{
$session = Yii::app()->session;
if (!isset($session['messages'])) {
$msgs = array($msgText);
} else {
$msgs = $session['messages'];
$msgs[] = $msgText;
}
$session['messages'] = $msgs;
}
And another one for errors that just uses the ‘errors’ key instead of messages. The purpose of this is to store messages to the user if the controller needs to redirect(). On init() the core Controller class looks at the session for messages and errors, and displays them accordingly.
Now, in Firefox or Opera, it works. it just plain works. Doesn’t matter what the redirect() URL is, doesn’t matter what the message is, it just plain works.
Chrome, however, is a different story. It… just plain doesn’t work.
I can confirm that, right up until the exact moment before redirect(), “Yii::app()->session[‘messages’]” will in fact have exactly the contents it should.
But when the page redirects… it’s gone. Right from the moment of page initialization. I even print_r’d the array. The user’s login is fine. Just the ‘messages’ and ‘errors’ indices (and possibly anything else I would set manually) are gone. Which is downright baffling, because I was under the impression that session data was all server-side.
Does anyone know what the problem could be, and why it only affects Chrome?