Clear flash session after calling setFlash?

I am working on a "Cookie Cake PHP 1.3 Application Cookbook", CH. 1 - section "Permission of logins with username or e-mail".

The problem is that when you log in using e-mail, even if you are successful, the flash message for "Invalid Account" is already set by the Auth component. Therefore, I need to cancel this message in the login action of the user controller user after a successful login by e-mail. Setting it to an empty line does not work, because an empty orange bar is displayed.

Is there a way to completely disable the flash message?

Thank you Jonah

+3
source share
3 answers

- CakePHP 1.3, SessionComponent :

$this->Session->delete('Message.flash');
+14

.

$this->Session->delete('Message.auth');
+5

If you are worried that the message is stored in memory after calling the Session-> flash () function in the view, you do not need to. Inside the flash () function, the message is cleared using this call:

CakeSession::delete('Message.' . $key);

Therefore, you will not need to delete the message yourself.

0
source

All Articles