My problem is that I can still log in even I typed in the wrong password. I can't seem to know if there's a problem on how I decoded the password.
encryption key:
$config['encryption_key']   = 'formcreatormj';
Log in code:
function login($email,$password){
    $pw = $this->encrypt->decode($password);
$this->db->where('email',$email);
    $this->db->where('password', $pw);
    $query=$this->db->get('user');
   if($query->num_rows()>0){
        foreach($query->result() as $rows){
            //add all data to session
            $this->addSession($rows->id, $rows->username);
        }
        return true;
    }
    return false; 
}
 
     
     
    