如果我第一次以user1身份登录并且第二次以user2身份打开新选项卡并登录,则我在会话中遇到问题,用户 2 能够查看 user1 权限的所有页面,如何在 php 中克服这个问题?如果user2转到user1的第一个选项卡,如何显示第一个作为登录页面
$this->is_logged_in();
$this->clear_cache();
}
function is_logged_in()
{
$is_logged_in = $this -> session -> userdata('is_logged_in');
if (!isset($is_logged_in) || $is_logged_in != true)
{
//redirect('/www.XXXX.ae');
}
}
function clear_cache()
{
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform,max-age=0, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
}
function logout()
{
$this->session->sess_destroy();
$this->session->set_userdata('userId',"");
$this->session->set_userdata('password',"");
$this->session->set_userdata('role',"");
$rurl = $this->session->userdata('rurl');
redirect($rurl,'refresh');
}
function login()
{
$this->session->sess_destroy();
$this->session->set_userdata('userId',"");
$this->session->set_userdata('password',"");
$this->session->set_userdata('role',"");
$username = $this->input->post('username');
$password = $this->input->post('password');
.......
}