I've been busy integrating Wordpress to 1 of the CakePHP application.Last Monday I cracked the best way to integrate it.Now one other issue I faced was that Client desired to auto login the customers who're login in CakePHP side,Used to do this too and delay pills work fine in local.I'm while using Session Variable of CakePHP that is occur core.php of cakephp,within the Wordpress also.The Code snippet from the Auto Login wordpress plugin is : -

session_name("Cake_PHP_Session_Vars");
session_start();
function auto_login(){if (!is_user_logged_in()) {
    //determine WordPress user account to impersonate
    $user_login = 'guest';

   //get user's ID
    $sessVars = $_SESSION['User'];
    $user_id = $sessVars['id'];

    //login
    wp_set_current_user($user_id, $user_login);
    wp_set_auth_cookie($user_id);
    do_action('wp_login', $user_login);
}}add_action('init', 'auto_login');

Everything works fine around the Local system however when I'm using it Server,It's not exercising.Please suggest me what is the issue here. Thanks Ahead Of Time

is the blog within different subdomain like blog.domain.com. for the reason that situation, a brand new session could be produced for blog customer unless of course you perform a deal with.

does your domain vary from domain.com to www.domain.com when you are from primary site to blog? if thats the situation, a brand new session can also be produced.

Well I fixed the issue I had been facing. I had been just establishing the present user's from Cake Side to Wordpress only with the User Id occur the Session variable.But there's an opportunity that incremented id's in Cake's User Table might be various and whenever we a are putting that into Wordpress_customers table it may be diverse from that.so within the new wordpress plugin I simply added a few of the line by which retrieve the username from the Drenched In user after which fetch the ID of this user,coz we all know that there's chance of getting two(or even more) Customers with same USERNAME.This is exactly why then we fetch the Id from the Username we've within the Session after which use

wp_set_current_user($user_id, $user_name);

All of you can easily see which i have changed $user_login (which was automatically set to Guest) with $user_title(fetched in the Session Variable).It is now working fine.The primary problem was that during my Local system Cake's Tables and Wordpress tables were Synced very nicely,however in server there is some trouble with the synchronization.