title: Block people from returning to site?
body: <p>I'm tasked with coming up with a way to determine if a person has reached our site via using their back button (meaning they left our site and came back) and log them out if so.</p>
  
  <p>I've come up with some options, but am wondering what other options I may be missing.</p>
  
  <p>FYI, we do have a session state, so server-side we're covered for long absences, but they want an additional check on the client side. </p>
  
  <p>option 1: set a cooking via onunload that expires in x seconds. On each page of our site, I check for said cookie. If it exists, I assume they came from another page on our site and do nothing. If it's not there, I assume they have been gone from our site more more than x seconds and redirect out. Con: Blackberry devices running OS5 don't support onunload.</p>
  
  <p>option 2: same as #1 but instead of setting cookie onunload, we set it on every click of every link that goes to another page on our site. con: messy</p>
  
  <p>option 3: <strike>check browser history on every load of every page of our site. If the previous URL is not one of ours, we log them out. Cons: browser support?</strike> It looks like previous/next history objects are now blocked in modern browsers due to security. </p>
  
  <p>Option 4: Via JS, every x seconds, check for a cookie. If it's there, reset it to expire in x seconds. If it's not there, assume they've returned from somewhere else. Con: Not sure if the JS cookies would be set while that page may be in the background (app switching on an iPhone, or using a different tab in a desktop browser).</p>
  
  <p>Any other options I should consider? Is there a 'proper' way to handle this? Is this just grasping at straws trying to prevent normal browser behavior? </p>