Browsing articles tagged with " CURL"
Jul
24
24
Maintaining PHP session when using CURL.
Working now on some iGoogle like dashboard for the system I’m developing.
I was trying some stuff out with CURL and was having a hard time to maintain my current session when making a curl request to another page. I needed to stay authenticated in order to retrieve my widget.
Here is my initial code:
$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/'; $ch = curl_init($rssFeedLink); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt( $ch, CURLOPT_COOKIE, $strCookie ); $response = curl_exec($ch); curl_close($ch);
The problem with that piece of code is that it was generating a new session id instead of sending my current session.
The solution? read more
Recent Posts
Tags
add-on
Ajax
alerts
api
application
Apps
border-radius
charts
CMS
CSS
CSS3
CURL
debug
dojo
Facebook
firebug
firefox
getsimple
google
iPhone
jAlert
JavaScript
jQuery
Linux
log
messages
optimization
PHP
plug-in
programming
prototype
Resources
session
squareit
tips
tweetmeme
Ubuntu
wildfire
XML
yahoo
Zend
Zend Framework
Zend Studio
Zend_Cache
Zend_Feed


