From 5cb5c671ee342cca908150d6dc90dafa5562b3f7 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Mon, 7 Mar 2016 23:00:32 +0100 Subject: [PATCH] Only one session is made. --- application/controllers/Login.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/application/controllers/Login.php b/application/controllers/Login.php index 6138a7a..6279e4d 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -10,17 +10,16 @@ class Login extends CI_Controller public function __construct() { parent::__construct(); + $this->load->library('session'); } public function index() { // redirect if session exists - $this->load->library('session'); - if($this->session->userdata('validated')){ redirect(base_url('/dashboard')); } - + $this->form_validation->set_rules('username', 'Username', 'required'); $this->form_validation->set_rules('password', 'Password', 'required'); @@ -81,7 +80,6 @@ class Login extends CI_Controller private function _startsession($userdata) { // Start session with user data - $this->load->library('session'); $this->session->set_userdata($userdata); // Redirect to dashboard