I try to redirect to a specific function in the same controller, but it doesn't redirect and only shows a white page (blank).
Trying to redirect to some specific url, it's still not moving to the url.
signin controller:
public function index()
{
$this->generateToken();
$data = array(
'title' => 'MASUK',
'breadcrumb' => 'MASUK',
'menu' => 'MASUK',
'login' => 'active',
'captcha' => $this->refresh_captcha(),
'msg' => '',
'infoMSG' => ''
);
if (isset($this->session->userdata['logged_in']['usr_email']) == "") {
$this->template->load('template', 'signin', $data);
} else {
//var_dump(base_url()); // show the base url
//redirect('https://www.facebook.com'); // not direct to specific url too
redirect('Signin/logout');
}
// else {
// redirect('landing');
// }
}
public function logout()
{
print_r("mask"); //not print anything
$this->load->library('session');
$this->session->unset_userdata('permission');
$this->session->unset_userdata('logged_in');
$this->session->unset_userdata('session');
$this->session->unset_userdata('userinfo');
$this->session->unset_userdata('api_loc');
$this->session->sess_destroy();
redirect('signin');
}
.htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
question from:
https://stackoverflow.com/questions/65859055/redirecting-function-not-redirecting 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…