Home php How do I delete cookies in PHP?

How do I delete cookies in PHP? [duplicate]




Please help me do the same:

$. removeCookie ('lk', {path: '/'});


$. cookie ('lk', '1', {expires: 7, path: '/'});
location.replace ("/ my-works /");
e.preventDefault ();

is only in PHP. IMPORTANT: You need to do this manipulation before loading the page content.

Answer 1, authority 100%

Just do it before generating the template.

unset ($ _ COOKIE ['lk']);
setcookie ('lk', null, -1, '/');

Answer 2, authority 25%


To delete a cookie, it is enough to specify some time in the past as the expiration date.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions