Well, you've got a basic idea of how the session works.
But you're overcomplicating the details. If Bob Smith logs in with a correct un/pw combo, you do this (after a session_start() call, of course...)
$_SESSION['user']=$_POST['name'];
And then Bob's name is in the $_SESSION array.
On each successive page that you wish to be able to identify Bob, (ie, protected pages, personalized pages, shopping cart, whatever) you call session_start(), and then the session array is available to that page, including our good 'ol $_SESSION['user'] variable, which in the case of Bob's browser will be set to the value "Bob" ... but Sally's browser will have the same variable set to "Sally" instead...
See, it's totally transparent (well, mostly!) There's no need to know what the session ID is, 'cause PHP tags the clients with a 'name tag' (usually via a cookie) and looks at the tag each time it talks to them. If you set $_SESSION['foo'] equal to "bar" for one user and "baz" for the next, PHP needs no special code to remember who's who... or to tell the third that he has no foo 😉
HTH 🙂