O
O
olezhenka2017-08-26 13:04:03
PHP
olezhenka, 2017-08-26 13:04:03

How to remember user actions and save them during the next page loading of the site?

By default, the menu on the site is open. I want that when the user closes it, the next time the page is loaded (not just the same one), it will also be closed.
In $_COOKIE, I can't update the parameter to close the menu, because when the button is pressed, the javascript function is launched, and php code cannot be executed in functions. Or maybe I can, tell me where to store data about the closed menu?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
ThunderCat, 2017-08-26
@olezhenka

cookies are local storage, JS can write to cookies and read from there, which is easy to check or google.

S
Stalker_RED, 2017-08-26
@Stalker_RED

What does php have to do with it? You can also set cookies via js.
But it's better to use localStorage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question