title: Set session/cookie for 24hs to show something only once per day to users
body: <p>I've been searching for the last hour how to do this... I think it's pretty easy, but couldn't make it work. </p>
  
  <p>I want to show something (AdSense) only once per day.</p>
  
  <p>I don't know what would be the best way, if using cookies or PHP Sessions. In any case, can you help me and tell me how could I do this?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Santiago</p>
  
  <p>Edit: I think this way I can create the Session, but I don't know how to "recreate" it each 24 hours and how to check for that session in order to show what I want to show once a day.</p>
  
  <pre><code>if (!isset($_SESSION['adSense']) 
      $_SESSION['adSense'] = time();
  
  if (time() - $_SESSION['adSense'] &lt;= 60*60*24 ) {
     return true;
  } else {
     return false;
  }
  </code></pre>