Set, Delete Cookie - Php

How to set and delete cookies using php code?

Snippet Code


  
Rate this page :
  [ 0 votes]

This php code used to create and delete cookie. Here, cookie name "hello" has been created and deleted.

setcookie("hello", "hscripts", time()+3600); if (isset($_COOKIE['hello'])) { setcookie("hello", "", time() - 3600); echo "Cookie Removed.."; }

Tags


Ask Questions

Ask Question