How to prevent of submission or back button after logout from session, any example or video link, please? Sory my english is very bad. This is my syntax
public function indexAction(){
if(isset($_SESSION['auth'])){
return $this->dispatcher->forward(
array(
"controller" => "admin",
"action" => "index"
)
);
}
}
public function sessionAction()
{
if ($this->request->isPost()) {
$email = $this->request->getPost('email', 'email');
$password = $this->request->getPost('password');
$password = sha1($password);
$user = Users::findFirst("email='$email' AND password='$password'");
if ($user != false) {
$this->_registerSession($user);
$auth = $this->session->get('auth');
$this->flash->success('Welcome ' . $auth['name']);
$this->response->redirect("admin/index");
}
$this->flash->error('Wrong email/password');
}
return $this->dispatcher->forward(
array(
"controller" => "login",
"action" => "index"
)
);
}
and this is admin/index
public function indexAction()
{
$auth = $this->session->get('auth');
if($auth == true){
$user = Users::findFirst($auth['id']);
if ($user == false) {
$this->flash->error('Anda tidak diijinkan mengakses laman admin tanpa melalui prosedur yang benar');
return $this->dispatcher->forward(
array(
"controller" => "login",
"action" => "index"
)
);
}
}
}