issue140.php 371 B

123456789101112131415161718
  1. <?php
  2. require_once 'utils.php';
  3. if (!empty($_POST)) {
  4. setcookie("tc", $_POST['cookie_value'], null, '/');
  5. } elseif (isset($_GET["show_value"])) {
  6. echo html_escape_value($_COOKIE["tc"]);
  7. die();
  8. }
  9. ?>
  10. <!DOCTYPE html>
  11. <html>
  12. <body>
  13. <form method="post">
  14. <input name="cookie_value">
  15. <input type="submit" value="Set cookie">
  16. </form>
  17. </body>