K
K
Kirill Gorelov2016-03-12 16:04:12
PHP
Kirill Gorelov, 2016-03-12 16:04:12

Cookies in php, implementation of comment output to the reader?

Hello.
Guys, there were a couple of questions about working with cookies.
There is a WordPress site.
And I want to display a message to readers whether they have read the article or not.
For one record, everything is more or less clear.
Cookies were created, we display one message that it was read or not. But what if there are several articles, how to make the script understand that it was this article that he read, and not some other?
How to move with such a problem, or rather in what direction?
Same question. This will not cause a load on the site, because cookies are stored in the reader's browser, right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Nikolaev, 2016-03-12
@Kirill-Gorelov

Store these statistics in the database. And so that there is no load, cache.

S
Silm, 2016-03-12
@Silm

1. Cookies are not stored forever
2. Different devices and browsers will have their own cookies
3. If there are a lot of materials, there will also be a lot of cookies. Each time they will race in the request. You can even go over the limit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question