This is the opposite to most people's problems.
When you close Safari by clicking the home button, it saves the current state of the page. If the memory is fine, then when you reopen Safari - the view will be exactly as you left it. I basically want to log a user out when they hit the home button.
Is there a way to force the page to refresh when you open Safari again. I couldn't see anything about an event that could be used, or similar?
The best idea I could come up with, was to have a constant javascript function running and comparing a time, so that when they reopen and javascript resumes, it will recognise that the time is different.
lc_theTime = new Date().getTime();
setTimeout('checkTime()',1000);
function checkTime() {
lc_newDateTime = new Date().getTime();
if (lc_newDateTime > (lc_theTime + 1500)) {
alert('ready to log out');
}
lc_theTime = lc_newDateTime;
setTimeout('checkTime()',1000);
}
Obviously, I don't really want a javascript function running constantly - but I don't see an alternative to do what I'd like. Any help would be great!