Jump to content

Remote session start & end !


php new bie

Recommended Posts

hi,

It may be a noob Q, but I'll appreciate any help :-)

 

www.example.com is a remote host that uses ASP applications and java scripts and window's frames.

 

So I need to get some data from these systems using

 

file_get_contents function but the site depends on session .

 

Any way to make a connection to the remote host and retrieve the generated session and use it through my code, then close the connection when the page completely loaded and if reloaded .. the cycle repeated by getting the new session and so on !

Link to comment
https://forums.phpfreaks.com/topic/158679-remote-session-start-end/
Share on other sites

your need to use cURL, with cookies, try this untested function

 

function cUrl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
return curl_exec ($ch);
}

 

PS i am having a bad phping day so this will probably fail!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.