Hello, I’ve installed a MODx an a ZEN Card Shop on the same server. They share the same database with different prefixes to access the ZEN Card Shop trough MODx DB-API. Now I want to login the MODx webusers in ZEN Card when thei login in the MODx frontend. Thats no problem whit the use of Web Access Service Events.
But how to do this in reverse? When the User logs in in the shop the MODx Session should also be startet. The Users in both Tables are always in sync trough hacking the weblogin-core files. when a user is updated in modx, a second querry also updates him in the ZEN Card table.
Is there a way to login/start the usersession with help of the MODx API? something like:
$modx->startwebsession($username,$password);
Or is there an even easier way?
thx for your help
shortee
-
MODX Staff
- 10,725 Posts
If I’m not mistaken, the application you are currently accessing must control the session. You are not going to be able to start a ZEN and MODx session on the same request; it’s a PHP session. This is why bi-directional synchronization of two user systems in PHP is pretty much worthless IMHO, because the issue is the session on the application server and how the application makes use of it.
Perhaps you could somehow check for a valid ZEN session using a plugin that would be able to auto-login the user to MODx. Unfortunately, there is not yet an API for this, but the development of that API is underway for future releases.