i have a page that shows a value from session, lets call it www.domain-a.com/master.php and if i type it directly from the browser, it shows me the session value.
but wh
There is one usefull solution.
Sending PHPSESSID to another server doesn't make a sense, because session data are stored in a file on the server and that is the reason why file_get_contents block http service. It is simple. Client connect to server using http and the server opens file with session data for writing of course. file_get_contents create another connection (another thread) that connect to the same server. If session id is set then server opens same file with session data, but this file is already opened.
so here is a good solution that prevents this collision:
$opts = array( 'http'=>array( 'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: ".session_name()."=".session_id()."\r\n" ) );
$context = stream_context_create($opts);
session_write_close(); // this is the key
$obsah = file_get_contents( 'http://blablabla.cz', false, $context);
it works fine. Yes yes yes