• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting the customer id if session is not set

#1
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

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!
Reply


Messages In This Thread
Getting the customer id if session is not set - by wolfgang1983 - 07-27-2016, 10:09 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.