Has anybody figured out a way to maintain the $_SESSION variable on a
redirect, when using Fat Free Framework? Currently, anytime I use a
redirect, my Flash Messages get cleared and will not display.
For instance, in the following code, neither message displays:
if ($verifyUser) {
$this->createUserSession($verifyUser);
if ($_SESSION['user_premium'] == 2) {
// Admin, so go to admin dashboard
$this->flash->addMessage('You\'re logged in as Administrator.', 'success');
$this->f3->reroute('/admin/index');
} else {
// Regular user, so go to regular dashboard
$this->flash->addMessage('You\'re logged in as a registered user.', 'success');
$this->f3->reroute('/dashboard/index');
}
}
Flash messaging works perfectly when redrawing a page (when
validating forms, for instance), but anytime I reroute, the session
variable seems to get cleared.
Any thoughts are gratefully accepted.