February 12th, 2011


 Hello. I trying to set cookies from php to parse an "only for friends" page. I have correct session (i get it from XML-RPC sessiongenerate), but LJ still shows me "You must log in to look at this entry. Please log in above to access the site.". I dont know why. How can i fix this issue?
I use something like this:

$opts = array(
'header'=>"Accept-language: en\r\n" .
"Cookie: ljloggedin=".$userid.";ljmastersession=".$session."\r\n" ) );
$url = 'http://'.$journal.'.livejournal.com/'.$ditemid.'.html?format=light';
$context = stream_context_create($opts);
$tempFile = file_get_contents($url, false, $context);

Userid something like 
u25378835:s1 and session v1:u25378835:s1:t1297530000:gc7fa046886033e0ae093793d0da6f93e788c848d//Thanks for signing in! LiveJournal loves you a lot! Here have a cookie