我的网站没有注销,在Codeigniter中从index.php
删除.htaccess
后,会话销毁无效。它在localhost中工作,但不在服务器上。
function logout() {
if ($this->session->userdata('admin_logged_in')) {
$useremail = $this->session->userdata('username');
$data = array(
'username' => $useremail,
'admin_logged_in' => true,
'logged_in' =>true
);
$this->session->unset_userdata($data);
$this->session->sess_destroy();
redirect('login');
}
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]