What is the reason that cookies mysteriously appear?

I am developing a web application that uses a cookie to store session information. I manually deleted session cookies because I am working on another piece of code where I do not want a login session. However, after the page is reloaded, the session cookie mysteriously appears again, including the earlier cookie, which I set only once for testing, then deleted and never used again.

I continue to manually delete cookies, but still, when I reload the page after a while, the cookies are returned. I double checked my code and I am sure that I do not set these cookies anywhere. At the moment, my code is in a single file and I am not including anything, so there is no way for me to skip something.

My code is in PHP and used the setcookie () call when I originally created these cookies.

I have not set a cookie expiration date. Uses Safari 4 Beta and GlimmerBlocker Proxy.

What is the explanation for this strange behavior?

+3
source share
3 answers

There are known issues with some browser cookie handling.

. : iSEC cookie

. Apple.com cookie.

+2

, cookie :

    session_start();
    // Unset all of the session variables.
    $_SESSION = array();
    // If it 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();
0

? ? - , cookie (~/Library/Cookies/Cookies.plist) .

0

Source: https://habr.com/ru/post/1705864/


All Articles