无法在codeIgniter中使用Tank_auth的注销功能

时间:2013-04-15 02:35:19

标签: php codeigniter

我已经彻底搜索了这个问题,但没有得到解决方案,最后我发布了这个问题。登录,注册新用户,在Tank_auth工作正常,但注销功能似乎不适合我。它显示以下错误

A PHP Error was encountered
Severity: Notice
Message: Undefined index: session_id
Filename: libraries/Session.php
Line Number: 272

A PHP Error was encountered
Severity: Notice
Message: Undefined index: ip_address
Filename: libraries/Session.php
Line Number: 272

A PHP Error was encountered
Severity: Notice
Message: Undefined index: user_agent
Filename: libraries/Session.php
Line Number: 272

A PHP Error was encountered
Severity: Notice
Message: Undefined index: last_activity
Filename: libraries/Session.php
Line Number: 272

A PHP Error was encountered
Severity: Notice
Message: Undefined index: session_id
Filename: libraries/Session.php
Line Number: 288

A PHP Error was encountered
Severity: Notice
Message: Undefined index: last_activity
Filename: libraries/Session.php
Line Number: 289

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\CodeIgniter\system\core\Exceptions.php:185)
Filename: libraries/Session.php
Line Number: 675

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\CodeIgniter\system\core\Exceptions.php:185)
Filename: helpers/url_helper.php
Line Number: 542

有人告诉我修改auth controller function logout()

中的注销功能
{
    $this->tank_auth->logout();
    $this->session->sess_create();//modified.....
    $this->_show_message($this->lang->line('auth_message_logged_out'));
    //redirect('','refresh');
}

它运行正常,但是当我刷新页面时,它将我重新定向回到用户已经出去的上一页,然后我再次搜索并将此行修改为设置为unset_userdata ..... in tank_auth class。

this->ci->session->unset_userdata(array('user_id' => '', 'username' => '', 'status' => ''));

这就是我到目前为止一直在等待帮助......

0 个答案:

没有答案