Could someone give me some examples of how to manage a login/logout for a "web" user via the API? Have figured out that I need to something the the following:
Login: $modx->runProcessor('security/login', array());
Logout: $modx->runProcessor('security/logout', array());
/J
This should do it:
<?php
$_POST['username'] = $user;
$_POST['password'] = $pass;
$_POST['service'] = 'login';
$_REQUEST['service'] = 'login';
$scriptProperties['loginResourceId'] = 499; // page you want to forward them to, if any
$modx->runSnippet('Login', $scriptProperties);
For logout, I think you can just change login to logout and leave out the username and password.