Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes Logout does not disconnect the user #32

Closed
micheldiemer opened this issue Oct 17, 2022 · 1 comment
Closed

Sometimes Logout does not disconnect the user #32

micheldiemer opened this issue Oct 17, 2022 · 1 comment

Comments

@micheldiemer
Copy link

Sometimes Logout does not disconnect the user. The cookie is not correctly removed.
In particular when changing the security level.
When removing the cookie, the options must be the same as when creating the cookie.

Fine includes/process-commands.php

/* EXISTING CODE */
case "logout":

    setcookie("uid", "deleted", time() - 3600);
    setcookie("username", "deleted", time() - 3600);

    /* NEW CODE TO ADD */
    /* Make sure the cookie is removed, no matter how it has been created */
    $l_cookie_options = array(
        'expires' => time() - 3600,              // 0 means session cookie
        'path' => '/',               // '/' means entire domain
        //'domain' => '.example.com', // default is current domain
        'secure' => FALSE,           // true or false
        'httponly' => TRUE,         // true or false
        'samesite' => 'Strict'          // None || Lax  || Strict
    );
    setcookie("username", "deleted", $l_cookie_options);
    setcookie("uid", "deleted", $l_cookie_options);

    //setrawcookie() allows for response splitting
    $lUsernameCookie = $lRecord->username;
    $l_cookie_options = array(
        'expires' => time() - 3600,              // 0 means session cookie
        'path' => '/',               // '/' means entire domain
        //'domain' => '.example.com', // default is current domain
        'secure' => FALSE,           // true or false
        'httponly' => FALSE,         // true or false
        'samesite' => 'Lax'          // None || Lax  || Strict
    );
    setrawcookie("username", "deleted", $l_cookie_options);
    setrawcookie("uid", "deleted", $l_cookie_options);
@webpwnized
Copy link
Owner

Thanks. Fixed in version 2.10.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants