Search code examples
phppersistent-connection

persistent php connection?


Is it possible to have a php script pause at a certain point wait for an ajax response, then continue executing?

If not, what is the most appropriate way to store the current state of a script (all defined variables ect) untill it in invoked again?


Solution

  • Making it wait for an ajax response which could never come sounds like a very bad plan (apart from being impossible due to the nature of http as a stateless protocol).

    What's wrong with using session to persist user data (you can store objects in the session)? It won't serialize the whole state automagically though.