I’m using the code below to add a user to a specific user group (which may or not be the best way of doing it...). This happens whilst the user is logged in. However, the new permissions don’t take effect until I flush sessions through the manager. Can I do that using the api? i.e. After the code below successfully completes, can I do something like $modx->flushMySessionDataButDontLogMeOut()?? (I have been rtfm-ing for longer that I care to add up btw...)
Code to add the user to the user group:
$assign = $this->modx->newObject('modUserGroupMember');
$data = array('user_group'=>$groupid,'member'=>$userid,'role'=>1);
$assign->fromArray($data);
$assign->save();
Thanks in advance