title: php set session with cookies
body: <pre><code>$_SESSION['user_id'] = $login;  
  setcookie('user_id', '$login' , time()+86000);
  header('Location: userindex.php');
  
  function logged_in() {
  return (isset($_SESSION['user_id']) || isset($_COOKIE['user_id']) ? true : false;
  }
  </code></pre>
  
  <p>I have SESSION but I wonna include COOKIE too but I don't know how to restart SESSION with COOKIE. I don't have a idea how I can get that. I create COOKIE but can't logout and have problem with SESSION somebody can help me to fix my problem???? And in every page on top I have logged_in function for check if user is logged in or not I wonna these logged_in function to check if user has cookie to auto login to user cookie. I think it is in logged_in function must get write some code and...</p>