Hi there, not posted here for a while as not had many problems with Revolution!
I don’t think this is a bug, just me not getting it right, but I need help getting a login page working on a multi-domain website set up. Basically I have multiple contexts set up, each referring to a separate domain name and all of the works nicely. I also have set up the ACL and this too seems to be working.
However I am now trying to simply set up a login page for users belonging to a user group to get to a separate section, but for the life of me, I can’t seem to get it to work.
I have tried to track the error as it seems to be that the session data is not being set. The issue appears to occur at Line 127 of model/modx/processors/security/login.php:
$rt = $modx->invokeEvent("OnWebAuthentication", $loginAttributes);
$rt returns nothing, but I’m sure this should be setting the session.
My login page is simply using [[!Login]], but it just loads the page without any errors etc or if I add a redirect url for logging in, then it works, but still has not user session, so the document page is not shown.
I have also set up a simply snippet for testing the values after logging in, but no user data seems to be getting set in the $_SESSION:
<?php
$to_return = 'Context: ' . $modx->context->get('key');
if ($modx->user->hasSessionContext($modx->context->get('key'))) {
$to_return .= 'Logged in';
} else {
$to_return .= 'NOT logged in';
}
$to_return .= print_r($_SESSION, true);
return $to_return;
?>
The context is correct but the results of this after submitting the login form are:
Array
(
[modx.user.contextTokens] => Array
(
[mycontext] => 3
)
[modx.user..attributes] => Array
(
[mycontext] => Array
(
[modAccessContext] => Array
(
[web] => Array
(
[0] => Array
(
[principal] => 0
[authority] => 0
[policy] => Array
(
[load] => 1
)
)
)
)
[modAccessResourceGroup] => Array
(
[3] => Array
(
[0] => Array
(
[principal] => 0
[authority] => 0
[policy] => Array
(
[load] => 1
[list] => 1
[view] => 1
)
)
)
)
[modAccessCategory] => Array
(
)
)
)
[mycontextDocgroups] => Array
(
[0] => 3
)
[modx.mycontext.session.cookie.lifetime] => 0
[modx.request.referrer.redirected] => Array
(
[q] => user-login.html
[username] => testuser
[password] => testuser
[returnUrl] => /user-login.html
[service] => login
[Login] => Login
[PHPSESSID] => 4f5092ef59eabda931d37bbd8e29c8cb
)
)
Any ideas?