Posted By

malkteroz on 06/10/16


php cookie delet

Versions (?)

Delete a Cookie

 / Published in: PHP


To delete a cookie, use the setcookie() function with an expiration date in the past:

  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.