Hotornot - How is the previous image remembered?

The question may make you smile, but how does this website preserve traces of the previous image? I mean, the center image is probably randomly selected, as well as the next image, but the previous image should match the one just rated by the user. Is this done through session variables? If so, how are identifiers attached and is there a limit on the amount of information?

PS: I also thought about cookies. It would be interesting to know what strategies are possible.

+4
source share
2 answers

If you looked at the sources, there is a hidden form field

<input type="hidden" name="rating[voted_on_id]" value="17915927" id="rating_voted_on_id" class="hidden"/>

My bet will be that this is the identifier you are looking for, since the other two are also stored this way in appearance ...

+2
source

Voting must be kept. I assume that the previous vote is stored in a database based on IP (or a combination of visitor information). Then, at any loading of a new page, the previous voting history is downloaded and used to download the image without voting for comparison.

There are perhaps many different ways: setting a cookie or adding session variables probably makes sense in the short term.

+2
source

All Articles