Welcome Guest, Not a member yet? Register   Sign In
Simple Acl
#1

hi , when an user log into my site a set 2 session variable :

 $_SESSION['user_id] and $_SESSION['role_id']

to redirect every view if the user aren't logged i try to insert an if in the construct :

Code:
   public function __construct() {
       
      parent::__construct();
     
      $this->load->library('session');
     
      $this->config->load('user_login');
     
      $this->load->model('user_model');
        
         if(!isset($_SESSION['user_id'])){
             redirect('user/login');
         
         }else{
             redirect('user/index');

      }


   }

But  the browser tell me that ther'are too many redirect . Why ?
Reply


Messages In This Thread
Simple Acl - by pippuccio76 - 09-02-2017, 03:41 AM
RE: Simple Acl - by Paradinight - 09-02-2017, 03:45 AM
RE: Simple Acl - by pippuccio76 - 09-02-2017, 03:51 AM
RE: Simple Acl - by Paradinight - 09-02-2017, 09:51 AM
RE: Simple Acl - by pippuccio76 - 09-03-2017, 01:32 AM
RE: Simple Acl - by InsiteFX - 09-03-2017, 03:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB