Jump to content

[SOLVED] file_get_contents on another domain, using user's cookies.


mattal999

Recommended Posts

Hi,

 

What I'm trying to do is retrieve the ownerid of a user logged into another site. To do this, I have tried using file_get_contents on the url and explode the correct part out. Now I have run into a problem. Using file_get_contents on the page works fine, but it uses the server's cookies, not the user's, so the page retrieved is a login page (basically). I can think of no other way to basically read what id the user logged in is.

 

This value is used in a url like so: http://www.domain.com/members/$theid, and I have written code to grab this id. Only problem now is requesting the page, basically using the user's local settings/cookies to get the correct, logged in page.

 

If not, then can I get the value of a cookie from another domain, called 'ownerid'?

 

Thanks,

mattal999

For a LONG list of security reasons, none of these options are possible. The only thing you can do to access the persons data from another server is to convince them to provide you their name/password for that site, then using the server to connect, login, and retrieve.

 

If you provide specifics on what you are trying to accomplish, i might be able to provide another option

For a LONG list of security reasons, none of these options are possible. The only thing you can do to access the persons data from another server is to convince them to provide you their name/password for that site, then using the server to connect, login, and retrieve.

 

That's exactly what I just thought of. Tried it and voila! With a bit of cURL, it works a treat. Thanks anyway.

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.