title: Wordpress, site redirect using cookies
body: <p>I have this site below where i'm playing with some Wordpress &amp; php cookies. <a href="http://johnnylai.me/lotus" rel="nofollow">http://johnnylai.me/lotus</a>  </p>
  
  <p>What i want to do is, when the user comes in the first time i want them to choose one of the two links at the frontpage(this is a seperate WP installation). Next time the same user comes back to the site i don't want them to see the frontpage anymore(b 4 the cookie is deleted or expired), i want them to go directly to one the the two sites - <a href="http://johnnylai.me/lotus/virksonhed" rel="nofollow">http://johnnylai.me/lotus/virksonhed</a> or <a href="http://johnnylai.me/lotus/privat" rel="nofollow">http://johnnylai.me/lotus/privat</a> - depending on what the clicked at the first time.</p>
  
  <p>I know i need some cookies stuff, but where to put the files and how to do it correctly i'm not sure.</p>
  
  <p>I'm thinking of a sulotion/php code in a file called function.php in the WP installation that have the frontpage(<a href="http://johnnylai.me/lotus" rel="nofollow">http://johnnylai.me/lotus</a>), but don't know if this is the right way to do it.</p>
  
  <p>Some code example would be nice :)</p>
  
  <p>Any help is appreaciated, thanks!</p>
  
  <pre><code>&lt;?php
      $expire=time()+60*60*24*30;
      setcookie("cat", "/cat1", $expire); 
  
      // But this is something with categoies in WP, that's not what i need.
  ?&gt;
  </code></pre>
  
  <p>And also</p>
  
  <pre><code>&lt;?php
     function has_auth_cookie()
     {
       // See if cookie is set
       if(isset($_COOKIE['lotus'])){
         // Do nothing
         header('Location: johnnylai.me/lotus/???');
       }
         else
       { 
         // Do Something else 
         header('Location: johnnylai.me/lotus/'); 
       }
  
     }
     add_action('http://johnnylai.me/lotus/????', 'has_auth_cookie');
     ?&gt;
  </code></pre>