07-27-2016, 10:09 PM
Hi, sorry for lots questions on auto logins I am just new at that.
I am creating a auto login for my front end system. When the session has expired it unset the customer id.
I use my readAutologin function to see if any rows return with customer id. But because it does not exist in the session or cookie I do not no the better way of being able to get customer id for my readAutologin
My cookie data only has tokens it has no customer id's
I was thinking instead of
What is your suggestion?
There is no encryption at the moment I am just playing around to it working?
Full Code Here
I am creating a auto login for my front end system. When the session has expired it unset the customer id.
I use my readAutologin function to see if any rows return with customer id. But because it does not exist in the session or cookie I do not no the better way of being able to get customer id for my readAutologin
My cookie data only has tokens it has no customer id's
PHP Code:
public function readAutologin() {
$this->CI->db->where('customer_id', '1');
$query = $this->CI->db->get($this->CI->db->dbprefix . 'customer_autologin');
if ($query->num_rows() == 1) {
return $query->row_array();
} else {
return false;
}
}
I was thinking instead of
PHP Code:
public function readAutologin() {
$this->CI->db->where('token', $this->CI->input->cookie('remember'));
$query = $this->CI->db->get($this->CI->db->dbprefix . 'customer_autologin');
if ($query->num_rows() == 1) {
return $query->row_array();
} else {
return false;
}
}
What is your suggestion?
There is no encryption at the moment I am just playing around to it working?
Full Code Here
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!