What's the reason for cookies mysteriously reappearing?

此生再无相见时 提交于 2019-12-06 03:57:05

There are known problems with certain browsers cookie handling.

See the following paper: iSEC Cleaning Up After Cookies

Also see this discussion on Apple.com regarding the case of the reappearing cookie.

Try this, it should remove all of your session cookies:

    session_start();
    // Unset all of the session variables.
    $_SESSION = array();
    // If it's desired to kill the session, also delete the session cookie.
    // Note: This will destroy the session, and not just the session data!
    if (isset($_COOKIE[session_name()])) {
        setcookie(session_name(), '', time()-42000, '/');
    }       
    // Finally, destroy the session.
    session_destroy();

What version of the OS are you using? What other apps are you using at the same time? These issues are generally due to apps stomping on the cookie storage file (~/Library/Cookies/Cookies.plist) one after another.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!