delete cookie in php

前端 未结 5 854
心在旅途
心在旅途 2021-01-28 06:01

I am trying to delete a cookie.

I am using setcookie(\"PHPSESSID\", \"\", time() - 6400); which deletes the cookie just fine.

However it is not enti

5条回答
  •  [愿得一人]
    2021-01-28 06:05

    This code can solve this problem:

    session_start(); // initialize session
    session_destroy(); // destroy session
    setcookie("PHPSESSID","",time()-3600,"/"); // delete session cookie
    

提交回复
热议问题