Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8696

Re: php curl only saves a cookie with tempnam()

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: php curl only saves a cookie with tempnam()
Date 2013-03-16 18:48 -0400
Organization A noiseless patient Spider
Message-ID <ki2sol$hs7$1@dont-email.me> (permalink)
References <dcd1e0bf-0bc9-432b-b089-e05e1f8bfd93@googlegroups.com>

Show all headers | View raw


On 3/16/2013 2:23 PM, doug@dougcassidy.com wrote:
>
>
> $tmpfile = tempnam('/tmp', 'CURL_tempnam_');
> d($tmpfile);  //string: /tmp/CURL_tempnam_lpeeqs --random string on end
>
> $tmpfile = '/tmp/CURL_var';
> d($tmpfile);  //string: /tmp/CURL_var
>
>      $ch = curl_init($url);
>      curl_setopt($ch, CURLOPT_COOKIEFILE, $tmpfile);
>      curl_setopt($ch, CURLOPT_COOKIEJAR, $tmpfile);
> [...]
>
> A cookie will be saved with the randomized name, even though I am setting the $tmpfile again. If I comment the
>
> $tmpfile = tempnam('/tmp', 'CURL_tmpfile');
>
> no cookie will be saved. What gives?
>

Did you copy/paste your code?  Or did you type it in again?

The code you show should not do this.  I highly suspect you left 
something (a lot?) out.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

php curl only saves a cookie with tempnam() doug@dougcassidy.com - 2013-03-16 11:23 -0700
  Re: php curl only saves a cookie with tempnam() Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-16 18:48 -0400
    Re: php curl only saves a cookie with tempnam() Doug Cassidy <doug@dougcassidy.com> - 2013-03-16 23:46 -0700
      Re: php curl only saves a cookie with tempnam() Doug Cassidy <doug@dougcassidy.com> - 2013-03-16 23:52 -0700
      Re: php curl only saves a cookie with tempnam() Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-17 10:03 -0400
        Re: php curl only saves a cookie with tempnam() Doug Cassidy <doug@dougcassidy.com> - 2013-03-17 09:42 -0700
          Re: php curl only saves a cookie with tempnam() Doug Cassidy <doug@dougcassidy.com> - 2013-03-17 10:16 -0700
            Re: php curl only saves a cookie with tempnam() Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-17 21:13 -0400
              Re: php curl only saves a cookie with tempnam() Doug Cassidy <doug@dougcassidy.com> - 2013-03-18 11:02 -0700
                Re: php curl only saves a cookie with tempnam() Doug Cassidy <doug@dougcassidy.com> - 2013-03-18 21:46 -0700
                Re: php curl only saves a cookie with tempnam() Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-19 09:06 -0400

csiph-web