modUser.isAuthenticated
Last updated Apr 17th, 2019 | Page history | Improve this page | Report an issue
modUser::isAuthenticated¶
Determines if this user is authenticated in a specific context.
Separate session contexts can allow users to login/out of specific sub-sites individually (or in collections).
Syntax¶
boolean isAuthenticated ([string $sessionContext = 'web'])
Example¶
See if the User is logged into the 'web' context. If not, deny access and send to Unauthorized Page.
if (!$modx->user->isAuthenticated('web')) {
$modx->sendUnauthorizedPage();
}