title: PHP Sessions vs. Cookies
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6253633/cookie-vs-session">Cookie VS Session</a><br>
    <a href="https://stackoverflow.com/questions/11142882/php-how-do-cookies-and-sessions-work">PHP: How do Cookies and Sessions work?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to learn PHP. I have a project website where numbers are constantly being generated, and changed and stored in javascript variables. There is very little php involved except in storing these variables to a database when the user hits the "store to database" button. Today I was using the site, navigated to another website and went back and all my data was gone as i had not stored it to the database first. I would like to save that data so it repopulates if I leave the page. what would be the best method of doing this? php sessions, cookies, or javascript cookies? please advise, thanks in advance!</p>