Cookie is not destroying after Logout
<p>I am working with "Remember" feature in Modal form.
I tried to set the cookie only when i sends checkbook value, while logging. But whenever i logout from my account, the cookie still exists each time.
Also, when i am printing $_COOKIE[] array, i am finding some SESSION_ID.
Help  me in finding out the mistake.</p>

<p>Modal Form</p>

<pre><code>&lt;form role="form" method="post" id="login_Modal_checks"&gt;
  &lt;div class="form-group has-error"&gt;
     &lt;label for="username"&gt;&lt;span class="glyphicon glyphicon-user"&gt;    &lt;/span&gt;Username&lt;/label&gt;

    &lt;input type="text" class="form-control" name="loginUsername"  id="loginUsername" placeholder="Enter username"
       value="&lt;?php if(isset($_COOKIE['username'])) 
           {echo $_COOKIE['username'];} ?&gt;" &gt;
     &lt;/div&gt;

&lt;div class="form-group has-error"&gt;
    &lt;label for="psw"&gt;&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;    Password
&lt;/label&gt;

&lt;input type="password" class="form-control" name="loginPassword" id="loginPassword" placeholder="Enter password"
value="&lt;?php if(isset($_COOKIE['pass'])) {echo $_COOKIE['pass'];} ?&gt;"       &gt;
 &lt;i style="cursor: pointer" id="seePass" title="Click here to see password" class="glyphicon glyphicon-eye-open"&gt;
&lt;/i&gt;

   &lt;/div&gt;
    &lt;div class="checkbox"&gt;
   &lt;label&gt;&lt;input type="checkbox" id="remember" &lt;?php if(isset($_COOKIE['username'])) { ?&gt; checked &lt;?php } ?&gt;&gt;
                    Remember me
    &lt;/label&gt;
     &lt;/div&gt;

&lt;a id="login_Modal"  class="btn btn-success btn-block"&gt;&lt;span class="glyphicon glyphicon-off"&gt;&lt;/span&gt; Login&lt;/a&gt;

&lt;/form&gt;
</code></pre>

<p>Javascript Code</p>

<pre><code>$('#login_Modal').click(function (e){
    e.preventDefault();
    var remember = $('#remember').val();
                $.ajax({
        url: "form_login_process.php",
        type: 'POST',
        data:{'Username':username,'Password':password,'Remember' : remember},
        success: function (data)
        { //alert(data);}
});
</code></pre>

<p>form_login_process.php</p>

<pre><code>    $Remember = $_POST['Remember'];
  $sql = "select * from signup where username = '$Username' and password = '$Password'";
  $result = mysqli_query($link, $sql);

  if(mysqli_num_rows($result)&gt;0)

  {
    if(!empty($_POST['Remember']))
    {
        setcookie("username", $Username,time()+ (10 * 365 * 24 * 60 * 60));
        setcookie("pass", $Password,time()+ (10 * 365 * 24 * 60 * 60));

    }
    else
    {
        //if without clicked on checkbox the cookie still exist then destroy it 
        if(isset($_POST['Username']))
        {
            setcookie("username","");
        }

        if(isset($_POST['Password']))
        {
            setcookie("pass","");
        }

        }

      echo 'true';
      $_SESSION['username'] = $Username;
  }
  else
  {
      echo "false";
  }
</code></pre>