tank auth意外退出

时间:2013-07-16 16:00:06

标签: php codeigniter session codeigniter-2 tankauth

我正在为我的项目使用tank auth,但在工作时会意外地到期。

    public function __construct()
{
    parent:: __construct();


    $this->load->model("stulib");

    $this->load->library("Gen");
    $this->load->model('tank_auth/users','users');
    $this->load->library('tank_auth');
    $this->title='Angel';
    $this->user_id=$this->tank_auth->get_user_id();
    $this->school_id=$this->users->get_school();
    $this->school_name=$this->users->get_school_name($this->school_id);
    $this->yesterday=$this->studentlib->yesterday();

    if(!$this->tank_auth->is_logged_in())
      die("No access rio!");

}

那是我的控制者。我只在控制器的构造函数中检查了is_logged_in。

编辑:

  • 我在数据库中存储会话
  • 我没有使用任何ajax请求
  • 我使用twitter bootstrap框架

1 个答案:

答案 0 :(得分:2)

我在Tank Auth和CodeIgniter 2.1上遇到了类似的问题。

您可以在此处找到详细解释和解决方案

http://www.hiretheworld.com/blog/tech-blog/codeigniter-session-race-conditions

这些链接也可以帮助您: http://ellislab.com/forums/viewthread/199753/#962141

http://ellislab.com/forums/viewthread/203821/#951378