How to get the user section id when logged in. I am developing a solution for affiliates, however on the page of advertising material I would like to obtain the current id of the user who is logged in. the most you could do was just print the user's email, but instead of the email the user's real id is displayed In my case it would be a code snippet https://snarthost.com/aff.php?aff='>https://snarthost.com/aff.php?aff=$_SESSION["UserID"] $ _SESSION ["UserID"] = real user id the expected result would be this: https://snarthost.com/aff.php?aff='>https://snarthost.com/aff.php?aff=1 Remembering that this id is dynamic according to the user's login