I want to prevent some subpages ( with games ) from my website to be opened in multiple tabs per browser. I want just 1 subpage to be opened per browser. I am using PHP as server side language, and the games are in SWF format.
The user goes to the game listings, and then clicks a game icon, and a popup opens . The href attribute has been disabled and a onclick event has been added to each game icon.
But this doesn’t prevent the user from copying the game URL, then opening a new tab manually and paste in the URL.
Is there any way to achieve my goal ?
I was thinking that when the user clicks the game image, to use ajax and call a PHP on my server to set a security token. When the game is finished embeding, destroy the token. If the user copy pasted the URL into another tab, it will not work.
But what happens if the user refreshes the game page then ? Got any suggestions to this ?
Thank you
Edit: misunderstood originally. To allow only one page per user
On click
If they refresh it will set a new timestamp, killing their old game. If they open in a new browser it will refresh the timestamp, killing their old game.