How do I delete PHPSESSID on client computers

前端 未结 13 1674
滥情空心
滥情空心 2020-12-30 22:50

UPDATE ON THE PROBLEM:

  • On some browsers, we have two PHPSESSIDs.
  • One PHPSESSID is not set by me anywhere in my script
  • It has
13条回答
  •  北荒
    北荒 (楼主)
    2020-12-30 23:27

    Yeah, you need to set the cookie time to a negative value so the browser can delete it, in adition we set the stored value to empty string which also helps to delete the same cookie...

    This (a the top of your page) would do, just be sure to session_start() first:

    setcookie('PHPSESSID', '', -3600, '/cv');
    

    This works flawlessly on all my domains, I had this problem once.

提交回复
热议问题