在Codeigniter中删除index.php后,会话销毁无法在服务器中运行

时间:2015-07-01 08:16:25

标签: php .htaccess codeigniter session

我的网站没有注销,在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');
    }

的.htaccess

 RewriteEngine on 
 RewriteCond $1 !^(index.php|resources|robots.txt) 
 RewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d 
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]

0 个答案:

没有答案