Hi All,


I am integrating two websites with one login. One website is done in Core PHP(movies website) and the other one is SocialEngine(Zend, Social Networking Site). For both websites database is same. Now i want to login from movie website and should be able to use Social Networking Website aslo.

I started using CURL for this process. With below code i am able to login with same credentials and i am getting home page of my SocialNetworking Site. Problem is, when i click on any other link relating to SocialNetworking site, it's taking back to Login for that site. But still i am active in Movie Website.


PHP Code:
$random rand(10,100000000000000000);
$id "user"
$pw "user"

$fields = array('email'=>$id'password'=>$pw,'return_url'=>"64-L3NlL2luZGV4LnBocC9ncm91cHM=");

$ch curl_init(); 
curl_setopt($ch,    CURLOPT_COOKIESESSION,         true); 
curl_setopt($chCURLOPT_FOLLOWLOCATION1); // Allow redirection 
curl_setopt($chCURLOPT_COOKIEFILE"/var/www/se/temporary/session/sess_".$random);
curl_setopt($chCURLOPT_COOKIEJAR"/var/www/se/temporary/session/sess_".$random); 
curl_setopt($chCURLOPT_URL"http://localhost/test/index.php/login"); 
curl_setopt($chCURLOPT_POST1); 
curl_setopt($chCURLOPT_POSTFIELDS$fields); 
curl_exec($ch); 

How can i save session for total website with CURl? Is this way correct or is thr any other way to do this?