Answer the question
In order to leave comments, you need to log in
Check if the user has permission to receive data?
The essence of the question is this: there is a user profile page, how to check that the user entering the profile page is the owner of this page? $_SESSION['logged_in']=1 doesn't seem like a solid check to me.
PS. I'm using CodeIgniter.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
on authorization $this->session->set_userdata('user_id',1);
when checking if($this->session->userdata('user_id')!==false){ .... }
You can fully trust what came to you from the sessions, because. they are stored on the server, and fake SESSION_ID on the client is unrealistic.
if ($this->library->get_user_id() != $user['id']) {
redirect('error.php');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question