I'd like to know what a server does to run a php application. Below is what I think:
client A types www.blahblahblah.blah/
- Server resolves url and directory etc.
- Server go the index.php
- index.php has a Singleton Pattern Class in it with a static variable called instance. Now does the server allocate the memory to that static variable in its own RAM so that all the requests following this first one uses the same static variable, OR for every new request server allocates a new memory and that new memory will have a new space allocated to that static variable?
My confusion: if every request is run in its own memory space then what is a persistant connection?
Second thing I'm wondering about: Can i have a desktop programme i.e. special browser which is contineously sending a special key to my web application and my web application is sending the key back contineously to make HTTP a connection full instead of connection less ? .[*without javascript the browser connects to my APP ].
That way I can confirm who is connected to my APP as a client instead than who is connected to INTERNET. I know sessions but they make http connection less and then chance of spoofing and session hijacking is there. I know you can make session secure but still my App won't know if the client is dead so delete his data from session and tell others that client blah is disconnected.
Sorry for this dumb lenghtly questions.