<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP cURL Cookies Example</title>
	<atom:link href="http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/feed/" rel="self" type="application/rss+xml" />
	<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/</link>
	<description>Website development - HTML/XHTML, CSS, Javascript/AJAX, PHP, MySQL</description>
	<lastBuildDate>Tue, 16 Feb 2010 04:02:15 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mike Lopez</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-212</link>
		<dc:creator>Mike Lopez</dc:creator>
		<pubDate>Tue, 16 Feb 2010 04:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-212</guid>
		<description>Yup, that&#039;d be a good idea.</description>
		<content:encoded><![CDATA[<p>Yup, that&#8217;d be a good idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Gonzalez</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-211</link>
		<dc:creator>Robert Gonzalez</dc:creator>
		<pubDate>Mon, 15 Feb 2010 18:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-211</guid>
		<description>Shouldn&#039;t you unlink() the tempfile so as not to have a bunch of unused files laying around in your file system?</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t you unlink() the tempfile so as not to have a bunch of unused files laying around in your file system?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Lopez</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-210</link>
		<dc:creator>Mike Lopez</dc:creator>
		<pubDate>Mon, 15 Feb 2010 04:35:55 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-210</guid>
		<description>1. Yes.  The first request sets the cookie.
2. Not sure, but I think it does it automatically.</description>
		<content:encoded><![CDATA[<p>1. Yes.  The first request sets the cookie.<br />
2. Not sure, but I think it does it automatically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hany B</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-209</link>
		<dc:creator>Hany B</dc:creator>
		<pubDate>Sat, 13 Feb 2010 00:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-209</guid>
		<description>Thanks a lot for this, great simple tutorial that i will be testing right away!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this, great simple tutorial that i will be testing right away!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-208</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 10 Feb 2010 14:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-208</guid>
		<description>1. Is it nessesary to do two requests?

2. Can curl automaticaly remove expired cookies form file ?</description>
		<content:encoded><![CDATA[<p>1. Is it nessesary to do two requests?</p>
<p>2. Can curl automaticaly remove expired cookies form file ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xQmail.eu</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-109</link>
		<dc:creator>xQmail.eu</dc:creator>
		<pubDate>Wed, 16 Dec 2009 19:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-109</guid>
		<description>Great tutorial, simple and to the point, thanks!</description>
		<content:encoded><![CDATA[<p>Great tutorial, simple and to the point, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yogesh</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-106</link>
		<dc:creator>Yogesh</dc:creator>
		<pubDate>Tue, 24 Nov 2009 10:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-106</guid>
		<description>Object Moved error in above cookies example for my url through</description>
		<content:encoded><![CDATA[<p>Object Moved error in above cookies example for my url through</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Feroz</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-104</link>
		<dc:creator>Feroz</dc:creator>
		<pubDate>Fri, 23 Oct 2009 10:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-104</guid>
		<description>hi,

File on another host... calling form http://localhost/test.php
----------------------------------------------------------------------------------------
$url =&quot;http://localhost/taiba/tfcsadmcp/index.php&quot;; 
$reffer = &#039;http://localhost/taiba/tfcsadmcp/index.php&#039;;
$cookie_file_path = getcwd().&quot;/tfcsadmcp/_files/cookie.txt&quot;;
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_AUTOREFERER, 0);
//curl_setopt($curl, CURLOPT_REFERER, $reffer);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER[&#039;HTTP_USER_AGENT&#039;]);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); 
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_COOKIE, session_name() . &#039;=&#039; . session_id());
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POSTFIELDS, &quot;username=admin&amp;password=323123&amp;pageaction=login&amp;&quot;);
$data = curl_exec ($curl);
$signupStr=getSignupString($data);

curl_setopt($curl, CURLOPT_URL,&quot;http://localhost/taiba/tfcsadmcp/index.php?component=cman&amp;page=wce.gall.php&quot;);//set this URL to wherever the form submits to
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($curl, CURLOPT_POST,1);//yes we want to post
curl_setopt($curl, CURLOPT_POSTFIELDS,$signupStr);//tell it where to find our sign up string
$data=curl_exec($curl);
curl_close($curl);//close the session

echo $data;

NOTE: But I can&#039;t access another pages after i login.. only the calling page i can access and the target web is using cookies and session.
Login is working prefect..</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>File on another host&#8230; calling form <a href="http://localhost/test.php" rel="nofollow">http://localhost/test.php</a><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
$url =&#8221;http://localhost/taiba/tfcsadmcp/index.php&#8221;;<br />
$reffer = &#8216;http://localhost/taiba/tfcsadmcp/index.php&#8217;;<br />
$cookie_file_path = getcwd().&#8221;/tfcsadmcp/_files/cookie.txt&#8221;;<br />
$curl = curl_init();<br />
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);<br />
curl_setopt($curl, CURLOPT_HEADER, 0);<br />
curl_setopt($curl, CURLOPT_POST, 0);<br />
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);<br />
curl_setopt($curl, CURLOPT_AUTOREFERER, 0);<br />
//curl_setopt($curl, CURLOPT_REFERER, $reffer);<br />
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);<br />
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);<br />
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);<br />
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);<br />
curl_setopt($curl, CURLOPT_COOKIE, session_name() . &#8216;=&#8217; . session_id());<br />
curl_setopt($curl, CURLOPT_URL, $url);<br />
curl_setopt($curl, CURLOPT_POSTFIELDS, &#8220;username=admin&amp;password=323123&amp;pageaction=login&amp;&#8221;);<br />
$data = curl_exec ($curl);<br />
$signupStr=getSignupString($data);</p>
<p>curl_setopt($curl, CURLOPT_URL,&#8221;http://localhost/taiba/tfcsadmcp/index.php?component=cman&amp;page=wce.gall.php&#8221;);//set this URL to wherever the form submits to<br />
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path);<br />
curl_setopt($curl, CURLOPT_POST,1);//yes we want to post<br />
curl_setopt($curl, CURLOPT_POSTFIELDS,$signupStr);//tell it where to find our sign up string<br />
$data=curl_exec($curl);<br />
curl_close($curl);//close the session</p>
<p>echo $data;</p>
<p>NOTE: But I can&#8217;t access another pages after i login.. only the calling page i can access and the target web is using cookies and session.<br />
Login is working prefect..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: erdosam</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-102</link>
		<dc:creator>erdosam</dc:creator>
		<pubDate>Tue, 20 Oct 2009 12:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-102</guid>
		<description>Yeah, nice xample, dude.. Simple but short :D</description>
		<content:encoded><![CDATA[<p>Yeah, nice xample, dude.. Simple but short :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SlipperyPeet</title>
		<link>http://coderscult.com/php/php-curl/2008/05/20/php-curl-cookies-example/comment-page-1/#comment-100</link>
		<dc:creator>SlipperyPeet</dc:creator>
		<pubDate>Wed, 30 Sep 2009 16:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://coderscult.com/?p=42#comment-100</guid>
		<description>Great article!  Another example of pulling cookies (and header) values directly into a variable dynamically without any file i/o can be seen here:  http://elame.com/damnthatsannoying/?p=7</description>
		<content:encoded><![CDATA[<p>Great article!  Another example of pulling cookies (and header) values directly into a variable dynamically without any file i/o can be seen here:  <a href="http://elame.com/damnthatsannoying/?p=7" rel="nofollow">http://elame.com/damnthatsannoying/?p=7</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
