title: What is the easiest way to log how long someone is viewing a page using PHP?
body: <p>What is best/cleanest method of tracking how long someone stays on a page? I know Google Analytics does this but I require the data to be stored locally within a preset database. </p>
  
  <p>Any ideas of how best to go about this?</p>