When developing a PHP backend I've decided to use a static variable to save the logged in user. If I'm not mistaken this can only work if each call to the backend creates a new instance of that backend. Else when two calls overlap the logged in user might be overridden, producing a wrong result.
It's proving difficult to find the answer and so I tried writing a unit test that just checks if the static 'logged in user' variable still exists when a call to the backend is finished. This showed me that the variable was indeed null. Just to be sure I decided to ask this question here.