I’ve recently came across a scenario where I wanted to pull out my hair again and realized I might have stumbled upon a problem within the Login package.
What happened is that I could login using it on the website we are developing, but was unable to logout, as this would result in an error page where it stated it was unable to redirect. I traced it to the piece of code:
$modx->sendRedirect($_SERVER['REQUEST_URI']);
I changed this to redirect to the front page by default when you logout, but this in effect caused me not being able to logout from the front end of the site.
Then I proceeded to logout of the manager, and in a last attempt decided try logging out again on the front end, and it worked. I logged in again, and logged out, logged in, and then also logged into the manager, tried logging out on the front end and then I got the error. As soon as I logged out from the manager I was able to log out on the front end again.
For some reason when the same user is logged in on both the mgr and web context (maybe multiple contexts to keep it generic) then the Login package didn’t want to logout the web context user and proceeded to through an error.
We are currently using modx 2.0.2-pl (will in this week be upgrading to 2.0.4) as well as Login 1.3.1-pl.