2 回答
TA贡献1807条经验 获得超9个赞
检查构造中的会话
function __construct ()
{
parent ::__construct ();
if ($this -> session -> userdata ( "akses" ) == 1) {
redirect ( "admin/dashboard" , "refresh" );
}
if ($this -> session -> userdata ( "akses" ) == 2) {
redirect ( "user/dashboard" , "refresh" );
}
}
TA贡献1796条经验 获得超4个赞
生成一个会话以了解管理员是否登录--
$this->session->set_userdata('is_admin_login', 1)
检查会话是否在您的登录网址(控制器)上生成--
function index(){
if ($this->session->userdata('is_admin_login')) {
redirect('admin/home'); // redirect to desired location
}
$datatitle['title'] = 'Login LPPM UTY';
$this->load->view('auth/tamplate/auth_header', $datatitle);
$this->load->view('auth/login_v');
$this->load->view('auth/tamplate/auth_footer');
}
- 2 回答
- 0 关注
- 98 浏览
添加回答
举报