Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.