title: why this code doesnt work and I cant expire the cookie?
body: <p>Hello the <em>expire</em> button is not working! whats the problem?
  I want to expire the cookie when the user clicks the <em>expire</em> button.
  please tell me the problem and the correct form of the code.Please tell me the reason!
  I recently started php so Idont know much things aboat it.please explain it very simple.
  I also added the codes and the picture!
  <a href="https://i.stack.imgur.com/N0285.png" rel="nofollow noreferrer">imag_1</a></p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;Document&lt;/title&gt;
      &lt;link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"&gt;
      &lt;script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"&gt;&lt;/script&gt;
      &lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"&gt;&lt;/script&gt;
      &lt;style&gt;
          body {
              text-align: center;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form method="POST"&gt;
          &lt;div class="form-group"&gt;
              &lt;input placeholder="Cookie name" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="name"&gt;
              &lt;input placeholder="Cookie value" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="value"&gt;
          &lt;/div&gt;
          &lt;button type="submit" class="btn btn-primary" name="submit"&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
      &lt;?php
      if (isset($_POST["submit"])) {
          $Cookiename = $_POST["name"];
          $Cookievalue = $_POST["value"];
          if (!empty($Cookiename) &amp;&amp; !empty($Cookievalue)) {
              setcookie($Cookiename, $Cookievalue);
          } else {
              echo "&lt;div class='alert alert-danger' role='alert'&gt;Please fill the fields!!!&lt;/div&gt;";
          }
      }
      ?&gt;
      &lt;body class="container"&gt;
  
          &lt;table class="table table-light"&gt;
  
              &lt;thead class="thead-light"&gt;
  
                  &lt;tr&gt;
  
                      &lt;th&gt;Cookie name&lt;/th&gt;
  
                      &lt;th&gt;cookie value&lt;/th&gt;
  
                      &lt;th&gt;&lt;/th&gt;
  
                  &lt;/tr&gt;
  
              &lt;/thead&gt;
  
              &lt;tbody&gt;
  
                  &lt;?php foreach ($_COOKIE as $key =&gt; $val) { ?&gt;
  
                      &lt;tr&gt;
  
                          &lt;td&gt;&lt;?php echo $key ?&gt;&lt;/td&gt;
  
                          &lt;td&gt;&lt;?php echo $val ?&gt;&lt;/td&gt;
  
                          &lt;td&gt;&lt;form method="POST"&gt;&lt;button type="submit" class="btn btn-primary" name="expire" value="&lt;?php echo $key; ?&gt;"&gt;expire&lt;/button&gt;&lt;/form&gt;&lt;/td&gt;
  
                      &lt;/tr&gt;
  
                  &lt;?php } ?&gt;
  
              &lt;/tbody&gt;
  
  
          &lt;/table&gt;
      &lt;/body&gt;
  
  
  &lt;/html&gt;
  
  
  &lt;?php
  if (isset($_GET["expire"])) {
      setcookie('$_POST["expire"]','', time() - 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
      echo '$_POST["expire"]'.'is deleted!';
  }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>