I am setting a cookie with this code:

<?
  require("connection.php");

?>
<?
  if (isset($submit_login)) {
        # setup SQL statement
        $pword=md5($pword);
        $SQL2 = "select * from clients where uname='$uname' and
pword='$pword'";
        $result2 = mysql_db_query($db,"$SQL2",$connection);
        $affected_rows = mysql_num_rows($result2);
        if($affected_rows>0){
          $myrow2 = mysql_fetch_array($result2);
          $clientid=$myrow2["id"];
          $fname=$myrow2["fname"];
          $cookievalue=md5($uname.$password);
          setcookie("aircharteruser",$cookievalue,time()+1800,"/");
                    }
                  }

 ?>

and then checking in my other pages to see if it is set here..

<?
 if (!isset($HTTP_COOKIE_VARS['aircharteruser']))
   { header("location: login_clients.php");}
 ?>

The only problem is once the cookie is set, it never seems to go away.  This
one should have expired in 30 minutes right?  I can still go in and get to
the other pages without it telling me to log in.  What did I do wrong?

Thanks!
Eddie


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to