PHP CURL cookie not sent in the website but works in the localhost test -


$ch=curl_init(); curl_setopt($ch,curlopt_url,$url); curl_setopt($ch,curlopt_header,false); curl_setopt($ch, curlopt_cookie,"denial=93a7a7e8b5af9f19a6df5e9850f8a64a;"); curl_setopt($ch,curlopt_returntransfer,1); $the_source = curl_exec($ch); //echo $the_source; curl_close($ch); 

the code works in localhost, not work in real site, have check curl installed , works when using post method not method. keep googling hours no solution yet. appreciate.

it server depended problem. or 3rd tools on server.

for example this issue looks similar.

the problem hosting use special "php protection system suhosin" encrypt session (session cookies) curlopt_cookie not work.

the solution disable suhosin.session.encrypt parameter in /etc/php5/conf.d/suhosin.ini file:

suhosin.session.encrypt = off 

did try answer in server os community ? know "specail" php tools on server installed ? describe in question.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -