Maintain the state of an object on different pages using PHP

how to do this using PHP OOP to maintain the state of an object in different pages.

the problem is that im always instantiates an object on every page.

Is there a solution that I will create once and maintain its object on different pages.

Thank you in advance

+3
source share
2 answers

In PHP, almost everything is created on every hit page. If you want to save state, you have a choice:

  • For user data, you can put it in a cookie ( not recommended for security reasons);
  • , ;
  • , ;
  • - (, memcached).

, , , , .. (, , ..).

, , , , . , , , . , .

+9

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


All Articles