title: Persistent data in a web app
body: <p>What is the best way of storing persistent data ? I want to save the time the user was last active on the page.At first I used localstorage, then i switched to cookies because it seemed easier to use, now I'm thinking of storing it in a database.What do you suggest.  </p>
  
  <p>Also could you please suggest a good method of registering when a user left the page ? </p>