Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Getting the customer id if session is not set

$
0
0
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

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>