Posted By

malkteroz on 06/10/16


Tagged

php cookie delet


Versions (?)

Delete a Cookie


 / Published in: PHP
 

URL: https://t.co/xqUJsUF101

To delete a cookie, use the setcookie() function with an expiration date in the past: https://t.co/xqUJsUF101

  1. <!DOCTYPE html>
  2. <?php
  3. // set the expiration date to one hour ago
  4. setcookie("user", "", time() - 3600);

Report this snippet  

You need to login to post a comment.