Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Session issue with flashSession

Hi guys, seem to be having an issue with flash session, only happening on one action

public function confirmAction()
{
    $email = urldecode($this->dispatcher->getParam('email'));

    $user = Users::findFirstByEmail($email);

    if ($user) {
        $user->setConfirmed(Users::USER_CONFIRMED_TRUE);

        if ($user->save()) {
            $this->flash->success('Account confirmed, you may now login');
        } else {
            $this->flash->error('Failed to confirm account...');
        }
    } else {
        $this->flash->error('Failed to confirm account...');
    }

    return $this->response->redirect('/');
}

This works everywhere else but here, and the issue is, the session is set but only shown after you refresh one more time after the redirect so not entirely sure what the issue is. has anyone else experienced this issue?



1.1k
Accepted
answer
edited Apr '15

Hi,

the injected flash service is there an instance of Phalcon\Flash\Session ?