Unset cookies php

前端 未结 8 1943
萌比男神i
萌比男神i 2021-01-04 09:28

I have this code that setted when login check is fine:

if((isset($_POST[\"remember_me\"]))&&($_POST[\"remember_me\"]==1))
    {
    setcookie(\'email         


        
8条回答
  •  旧巷少年郎
    2021-01-04 10:18

    In Chrome and IE8+ at least, the following will remove the cookie from the browser. It will not be reflected in the $_COOKIE array until the page is reloaded however.

    setcookie('cookiename','',0,'/',$cookieDomain)

    you may be able to leave off a few parameters here, but the important thing is you are setting an empty string, and that removes the cookie from the browser.

提交回复
热议问题