4
4
4shamrock2015-04-07 02:50:34
CodeIgniter
4shamrock, 2015-04-07 02:50:34

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

4 answer(s)
X
xmoonlight, 2015-04-07
@xmoonlight

well, in vain, it does not seem)

D
dmitriy, 2015-04-07
@dmitriylanets

on authorization $this->session->set_userdata('user_id',1);
when checking if($this->session->userdata('user_id')!==false){ .... }

E
evnuh, 2015-04-07
@evnuh

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.

V
Vyacheslav, 2015-04-09
@nskarl

if ($this->library->get_user_id() != $user['id']) {
    redirect('error.php');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question