Sharing symfony and wordpress session -
I am working on a solution with two applications
1) Wordpress based CRM (Foreground) 2 Symfony based B2C application
The Symphony application is created and working fine when we enter Symphony based application, the top menu changes in relation to the person's log. For example sign-in change sign-out, etc.
The thing is that we need this same menu on the WordPress based CRM, which should be updated when logging in any simphone based application.
Tell me if you have any experience or suggestions.
WordPress gives you control over cookie verification function wp_validate_auth_cookie
. Fortunately, this function is "plug-in", so you can rewrite it.
Ensure that WordPress can view Symphony's cookies (they are in the same domain), and then the function does something like this:
session_name ('symphony'); Session_start ();
This will give you access to Symphony's $ _ session
.
By default, user_id by default, $ _ session ['Symphony / SfUser / attributes'] ['sfGuardSecurityUser'] ['user_id']
Using sfGuard or sfDoctrineGuard
This function returns a WordPress user id, but there are many other possibilities (many other tasks that are "plug-ins" from this point.
Comments
Post a Comment