PHP: Is it possible to access the class after loading the page via ajax?

I was not sure that when a class is created using code in PHP, if it remains in the server cache, where it could be accessed using ajax (php file), or if it just dies after the script exits.

Can this be done using a Keep-Alive connection or something else?

I know that I show my ignorance in the pen, but at the risk of looking like an idiot, I had to ask.

Thank!

Edit: Oh, I also wanted to know if you can save the object in sessions for access?

+3
source share
1 answer

You can save the object in $ _SESSION and perform operations on it, like any other object (i.e.

$_SESSION['object']->method();
+2

Source: https://habr.com/ru/post/1754068/


All Articles