I’m working on a solution that has two applications
1) WordPress based CRM (frontend)
2) Symfony based b2c application
Symfony application is created and working fine. When we login to symfony based application, the top menu changes with respect to person logs in. e.g. sign-in changes sign-out etc.
The thing is we need to have this same menu on the WordPress based CRM, which should also be updated when someone logs in to symfony based application.
Let me know if you any experience or suggestion.
WordPress gives you control over cookie verification via the function
wp_validate_auth_cookie. Fortunately, this function is “pluggable”, so you can rewrite it.Make sure wordpress can see symfony’s cookies (they must be in the same domain), and then have the function do something like:
This will give you access to symfony’s
$_SESSION.The user_id is, by default,
$_SESSION['symfony/user/sfUser/attributes']['sfGuardSecurityUser']['user_id']If you’re using sfGuard or sfDoctrineGuard.
This function is expected to return a wordpress user id, but the possibilities from this point and on are multiple (there are plenty of other functions that are “pluggable”.