Good afternoon. There is a bulletin board. When you load the page shows a certain limit of ads. There is a "Next" button when clicking on which is accessed through ajax to a php file that rakes out the next portion of ads. Values are transferred from which position to select records for LIMIT.
Since the data loading is dynamic, the initial amount is displayed when switching to another page and then returning to the page with ads.
The task is when returning to display the number of ads that have been uploaded.
I tried to implement the institution in the session variable how many ads were loaded. But there are problems: 1) The session lifetime - clicking once, at subsequent visits (in an hour, a day, etc.) will output a footcloth, which is not good. Alternatively, you can add a time stamp and compare it with the current one - if older than 1 minute, reset the variable. 2) For each category, you will need to create your own variable in the session. With a large attendance number of variables in the session will grow very much.
Has anyone come across a similar one or can someone with a fresh look suggest a more optimal solution?