V
V
Vadim2014-07-13 12:14:37
Sessions
Vadim, 2014-07-13 12:14:37

How to make a record view counter?

Good afternoon
How it is better to implement the counter of viewing of records?
Now, when viewing a record, count + 1 is performed and element_{id} = show is written to the session; when viewing a record again, the counter will not work until the current session ends. How correct is this option? It is also planned to make an output of recently viewed records, then it will be more convenient to store an array of what was recently viewed in the session.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2014-07-13
@ShVad

I don't really understand what you want to do.
If you need to show on the site how many times you have looked at something - what does the session have to do with it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question