Welcome Guest, Not a member yet? Register   Sign In
Login Problems
#1

[eluser]khoo[/eluser]
Hi, anyone have any idea what could be the potential problems.

When a user enter the username and password.
If it is correct, it shall return the correct user details.

It seems to works fine on my system. However, when my customers login using their office network.
Somehow, it return a random user details.
Although, their are using each individual user login name and password.

#2

[eluser]khoo[/eluser]
Could it be due to 'this->session'?
I have it on most function.
Such as
Code:
$data = $this->session->all_userdata();
#3

[eluser]Otemu[/eluser]
Hi,

Can you post more code controller/model/view so we can try analysis your problem.
$this->session->all_userdata(); shouldn't cause an issue but depends how it is being used
#4

[eluser]khoo[/eluser]
Hi Otemu,
i believed i found the problem.
It could be the proxy issues that caused the conflicts between sessions.
Any idea how to get around the proxy?

the code are pretty standard.
main_controller
Code:
$this->login_model->validate_credentials();

//if return row == 1
      $userdata = array(
                  'user_id' => $data->user_id,
                  'user_name' => $data->user_name,
                  'user_email' => $data->user_email,
                  'is_logged_in' => 1
        );

      $this->session->set_userdata($userdata);
      redirect('/homepage_controller');

Model
Code:
//sample
    $email = $this->input->post('email');
    $password = $this->input->post('password');
    
    $safe_password = encryption method;


    $this->db->where('user_email', $email);
    $this->db->where('user_password', $safe_password);
    
    $query = $this->db->get('users');

    //If valid credential
    if($query->num_rows() == 1)
    {
      $data = $query->row();
      return $data;
    }
    else
    {
      return false;
    }

homepage_controller
Code:
if($this->session->userdata('is_logged_in'))
    {
      $data = $this->session->all_userdata();

      $this->load->view('templates/header', $data);
      $this->load->view('homepage_view/index', $data);
      $this->load->view('templates/footer');
    }
    else
    {
      redirect('/restricted_controller');
    }




Theme © iAndrew 2016 - Forum software by © MyBB