Sorry, but the user only exists because the framework is bootstrapped when index.php is loaded.
PHP does not natively support the concept of a user, although of course it does support sessions.
Without a library, you would need to start sessions, receive the login form from the user, validate it then store the user identifier in the session.
Next time the user returns, get the id from the session storage.
You will need some pretty old tutorials to cover this without using a framework because in real life, noone codes this from the ground-up any more. This might give you an idea.. https://www.formget.com/login-form-in-php/