Logout link not working
Hello I've been trying to get Login snippet to work on my revo 2.2.14-pl but somehow the logout link won't log me out .. after some google research i found it to be a bug
http://bugs.modx.com/issues/9326
Is there a possible fix for this?
For reference, here's the content of that bug:
emkay originally opened the bug:
this example taken from the rtfm (http://rtfm.modx.com/display/ADDON/Login.Login#Login.Login-Logout) won't log you out (of the frontend) if you have friendly urls == on and the resource is a container:
<a href="[[~21? &service=logout]]" title="Logout">Logout</a>
fine with any non-container resource ending with a virtual alias.html but won't play ball with /container/
scottwb responded: Sorry if this is the wrong place, but I've been trying to track down this bug for awhile. It occurs in ModX 2.2.6, and is not the login ad-don. The request is not being pulled from a $_GET call on a container with friendly url and no extension. My issue is landing page for a Context.
A quick fix is to run a $_POST instead of a $_GET. You need to manually change YOUR LOGOUT URL to your page url, Modx wont allow it to work using +logoutUrl.
example lgnLogoutTpl:
<form name="logmeout" action=" YOUR LOGOUT URL " method="post" enctype="multipart/form-data">
<input type="hidden" name="service" value="logout">
<a href="Javascript:void(0)" onclick="LogMeOut()">Log Me Out</a>
</form>
<script type='text/javascript'>
function LogMeOut(){
document.logmeout.submit();
}
</script>
rebel_forces suggested a fix in the forums: http://forums.modx.com/thread/44886/logout-not-working-for-login-snippet#dis-post-466978
tommls replied: I put the JS solution onto our logout page per se and it unfortunately goes to our unauthorized page but better than nothing. PLEASE FIX THIS!! and please announce this fix in the changelog!!