Associate logged in user with your information?

0

After doing the "session", how do I bring the user information logged in? I know it's not just creating a session, I need to bring user information like Name / Nickname, avatar, email etc.

    
asked by anonymous 23.08.2017 / 19:51

1 answer

1

You can make a select in your database by retrieving the user information and so you could set the object or a variable of the form you prefer containing the user in a session like this: $_SESSION['usuario'] = $usuario and access is almost same way:

$usuario = $_SESSION['usuario']
$usuario->getNome();
$usuario->getEmail();

In this example I do as if I were set the object of a user within session and I am getting its attributes through the get methods of that object. if you do not put the object of a user in the session and do not know how to access just just give var_dump($variavel) and have a better view about your variable

    
24.08.2017 / 01:14