cookie_page1.php 432 B

123456789101112131415161718192021
  1. <?php
  2. if (!isset($cookieAtRootPath)) {
  3. $cookieAtRootPath = true;
  4. }
  5. if (!isset($cookieValue)) {
  6. $cookieValue = 'srv_var_is_set';
  7. }
  8. setcookie('srvr_cookie', $cookieValue, null, $cookieAtRootPath ? '/' : null);
  9. ?>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <title>Basic Form</title>
  14. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  15. </head>
  16. <body>
  17. Basic Page With Cookie Set from Server Side
  18. </body>
  19. </html>