diff --git a/application/controllers/Login.php b/application/controllers/Login.php index ae582fb..6138a7a 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -16,8 +16,9 @@ class Login extends CI_Controller { // redirect if session exists $this->load->library('session'); - if(! $this->session->userdata('validated')){ - redirect('/dashboard'); + + if($this->session->userdata('validated')){ + redirect(base_url('/dashboard')); } $this->form_validation->set_rules('username', 'Username', 'required'); @@ -84,7 +85,7 @@ class Login extends CI_Controller $this->session->set_userdata($userdata); // Redirect to dashboard - redirect('/dashboard'); + redirect(base_url('/dashboard')); } }