Check if cookies are enabled


SUBMITTED BY: henry1874w

DATE: June 21, 2017, 11:33 p.m.

FORMAT: Text only

SIZE: 239 Bytes

HITS: 225

  1. <!DOCTYPE html>
  2. <?php
  3. setcookie("test_cookie", "test", time() + 3600, '/');
  4. ?>
  5. <html>
  6. <body>
  7. <?php
  8. if(count($_COOKIE) > 0) {
  9. echo "Cookies are enabled.";
  10. } else {
  11. echo "Cookies are disabled.";
  12. }
  13. ?>
  14. </body>
  15. </html>

comments powered by Disqus