How to get the script to run once a day?

The crux of the matter:
there are modelka advertising the departure of the master measurements
this modelka must be displayed to each customer site 1 time a day (for testing purposes - 1 time per hour)
CA can implement this?
The script output of modelki write in js in the footer (after the page loads wait 5 seconds and deduce modelco)
server side start the session and create the variable $_SESSION['show_modal'] = true;
And - if variable is not - then the script output, and after creating this variable, and if variable exists then the script does not deduce
This part works while the browser is open and the session is active (basically normal variant)
But then the customer began to swear that he constantly appears this modelka on each page
Then decided to work through cook - but again, the customer complains that every time you open a page (jump page), you will receive this modelka...
The question how to solve this problem?

PS like the customer has a dynamic ip address

Thank you
June 8th 19 at 16:57
2 answers
June 8th 19 at 16:59
June 8th 19 at 17:01
If modelka should be shown to all users, it makes sense to put cook with the desired lifetime (hour/day).
Here the main feature is that by default cook, without clearly-set time life exists until the browser is closed.

And Yes, before you call modelki will need to check cookies. On js it is quite simple.
Yes, I did - but it does not work at the customer with the cookie... - carmel_OReilly65 commented on June 8th 19 at 17:04

Find more questions by tags PHP