Could anyone show me how would I make this cookie last 30 days?

Discussion in 'JavaScript' started by mike33pt, Jul 11, 2009.

  1. #1
    Hi all, I have this code in my page to set a cookie. Thing is it is only a session cookie :-( Would appreciate it if someone show me how I make it last 30 days please?

    
    <?php
    if (isset($_GET['kw']))
      {
      setcookie('keyword', $_GET['kw']);
      $kw = $_GET['kw'];
      }
    if (isset($_COOKIE['keyword']))
      {
      $kw = $_COOKIE['keyword'];
      }
    ?>
    
    Code (markup):
    Thanks

    Mike
     
    mike33pt, Jul 11, 2009 IP