I'm working on a site where users submit photos which can be viewed one by one on a page.
There is another page where you see smaller versions of multiple photos.
When user clicks any of these smaller photos they get the large version page, pressing "next" will take them to another photo in that category.
I would very much like newer photos to have precedence over older photos.
My idea is that when user clicks next he is taken to the newest photo and moving next from there will take user backwards through all the new photos.
Problem is, when user leaves single photo page, goes back to multiple thumbs page and then clicks another photo there, user will start seeing the same new photos when clicking next.
I would like to ensure user does not see same photo. I thought about putting a unique cookie for each visitor and then when user vistits photo I record it in a visits table. When selecting new photo from db for 'next' I ensure that user has not visited that photo before.
I am (prematurely) worried about what effect this will have on database load.
Any ideas about what is the best way of doing this or an alternative method?
edit: Might not have been clear enough, very short version: I want to ensure no duplicate content when cycling through pictures. Preferably over an extended time, not only a session.