FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php curl only saves a cookie with tempnam()
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php curl only saves a cookie with tempnam() [message #180778 is a reply to message #180774] Mon, 18 March 2013 18:02 Go to previous messageGo to previous message
doug[1] is currently offline  doug[1]
Messages: 10
Registered: March 2013
Karma:
Junior Member
> Then what you're saying is the interpreter is broken. It is not setting
> $tmpfile to the new value; rather it is keeping the old value.

> In your code, if $tmpfile were actually being to the new value, there is
> no way curl_opt() could get the old value.

> What happens if you echo $tmpfile before and after the statement:
> $tmpfile = $tempdir.'/CURL_var_.txt';

string: C:\Users\sv32\AppData\Local\Temp\CURC9BD.tmp
string: C:\Users\sv32\AppData\Local\Temp/CURL_var_.txt

then, because of the static
string: C:\Users\sv32\AppData\Local\Temp/CURL_var_.txt
string: C:\Users\sv32\AppData\Local\Temp/CURL_var_.txt

One cookie in temp: CURC9BD.tmp

Without static, I get 5 cookies, each matching the tempnam() filename. I copy/pasted $tmpfile in each location of the code, to make sure i was using the correct var. Does the tempnam() lock in the var somehow? again, If I comment the $tmpfile = tempnam() part, I get no cookie, with a before and after of
NULL
string: C:\Users\sv32\AppData\Local\Temp/CURL_var_.txt

You notice the back and forward slashes, I have never had an issue with these, using EasyPHP on Win, back and forward slashes seem to work identically, except in str compares, of course.

Same results local and live.
$cookfile = curl_setopt($ch, CURLOPT_COOKIEFILE, $tmpfile);
$cookjar = curl_setopt($ch, CURLOPT_COOKIEJAR, $tmpfile);
both come back true.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: all done
Next Topic: validation of a text box input...
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 14 17:24:31 GMT 2024

Total time taken to generate the page: 0.07992 seconds