Page 1 of 1

PHP and browser cookies usage

Posted: Wed Dec 21, 2011 10:23 am
by gilcamar
Hi,
I am trying to code an app, for personal use, capable to collect nicknames of friends and friends of firends
of facebook.
Since this should be a very simple app, not intended to be a chat client or whatever, I decided non to use
fb libs.
Basically, I did use PHP Simple HTML DOM parser to fetch the page and parse it for certain tags.
It works fine for some web pages, but not for fb since it directs it to the login page.
I wonder if there is some way or script to use fb cookies already stored on ff.
Do you have other ideas on how to do this ? Maybe, I am completely off track.
TIA
Gilcamar

Re: PHP and browser cookies usage

Posted: Wed Dec 21, 2011 1:46 pm
by tr0gd0rr
You can send cookies using curl_setopt()

Code: Select all

curl_setopt($ch, CURLOPT_COOKIE, "fbsession=$session_id");
You can code it using curl options such that facebook couldn't even discern between a browser and your script.

Re: PHP and browser cookies usage

Posted: Wed Dec 21, 2011 3:17 pm
by gilcamar
Thanks, will try that.
I had to set
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
in order to let fb in at first.

gilcamar