Currently on my webpage I have a timer that runs a function every 30 seconds:
setInterval("someFunction(userId)", 30000);
This works fine, but the problem is if 100's of users leave their browser open (say when they go for lunch), it will poll our system and increase the load on our servers for no reason.
How can I stop this timer from running after say 20 minutes?