The following code over comes this problem and passes along PHP's $_SESSION information to the called page. This has been tested for pages on the same server, I'm not sure how it will work if calling a page from another server.
<!-- save $_SESSION to use in call -->
session_start();
$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';
session_write_close();
<!-- Begin cURL call-->
$curl_handle = curl_init('enter_external_url_here');
curl_setopt( $curl_handle, CURLOPT_COOKIE, $strCookie );
curl_exec($curl_handle);
curl_close($curl_handle);
No comments:
Post a Comment