Create domino session on apache/php server

Hi everybody,

I’m lookin for creating a domino user session, using an apache server (with PHP). Here is a description of what I aim:

I have a PHP/APACHE Website on a server (let’s call it apacheserver.mydomain.fr)

I have another server: DOMINO (called domino.mydomain.fr)

On this website(apacheserver) I have a login box. When the user is logging in, my PHP script check information on the Ldap Domino server. No problèm with this.

What I need, is to create a session (while logging in the website(apacheserver), on the domino server, in order to allow the user to visit any domino web page, without logging in again.

I heard about SSO and LTPA Cookie. I configured the domino server on SSO. I even found the following PHP script:

$url="http://domino.mydomain.fr/names.nsf";

$req="username=foobar&password=bar123";

$opts = array(

"http"=>array(

"method"=>"POST",

"content" => $req,

"header"=>"Accept-language: en\r\n" . 

	"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" . 

	"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*\r\n" 

   	)

);

$context = stream_context_create($opts);

if (!($fp = fopen("$url?Login", "r", false, $context))) {

	die("Could not open login URL");

}



$meta = stream_get_meta_data($fp);

fclose($fp);

for ($j = 0; isset($meta['wrapper_data'][$j]); $j++)

{

	if (strstr(strtolower($meta['wrapper_data'][$j]), 'set-cookie'))

	{

		$cookie = substr($meta['wrapper_data'][$j],12);

		break;

	}

}

Actually, this script get the HTTP response, and extract the cookies created by the domino server. Then, I should just have to register the cookie on the client navigator, and the session should be created.

The problem is that the HTTP response DOES NOT send me any cookie !

Is there something to configure on the domino server in order to allow it to send cookies to the apache server?

Maybe this is the wrong way to create domino session on apache server?

Thankyou in advance for you help