> How do I get a users info using php sessions?The user is logged in and submitting a form am wanting to get their registe

How do I get a users info using php sessions?The user is logged in and submitting a form am wanting to get their registe

Posted at: 2014-12-18 
It depends on how you did this. For instance, when the user logged in and you stored their user_id in a session variable:

$_SESSION['user_id'] = $row['user_id'];

Then, in another page that needs this information, just reference the same reference variable:

$result = mysqli_query($con, "SELECT * FROM users WHERE user_id = $_SESSION['user_id']");

you do not. you need to use the database to look them up.