This might be a bit of a stupid question, but I'm not starting from the background of OOP, and although I read and study when I go, I'm still afraid of a few concepts.
I am currently working with PHP 5.3 and request a simple registration using several classes of objects: User, which defines the user. A session that starts and maintains session data, and if someone is logged in, and a database that performs queries.
So, when my script is running, my session object is created, etc. here is my problem. When I go from one page to another, how is this object tracked? Or maybe my question is how does PHP know the objects associated with my input, mine, and not someone else who visited the site?
I know that if I do this in a non-OOP way, I just check the session cookie on each page and check my data in such a way that well, my brain can handle it. But where and how are object data tracked.
EG: On every page I want to check if any of me are registered. I refer to $ session-> is_logged_in (), etc. Is_logged_in verifies that the name of the private variable is true or false. There is no cookie validation, which means that this object still exists, and since it continues to request the stored variable, the instance should remain useful ... but like PHP, the server, regardless of whether this instance of this object is bound to this user ? If all these objects float around on the server until I destroy them, will there be a lot of memory used by the objects?
, , , , , , , PHP.