+ Reply to Thread
Results 1 to 5 of 5

Thread: cURL Cookie Trouble

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    6

    Default cURL Cookie Trouble

    I'm working on a PHP script that uses cURL and cookies. It runs fine on my local machine and writes all of about 5 variables to the cookie. When I run it on my shared hosting, only 2 of the variables are written to the cookie and they don't have the correct values. I am using the same version of PHP and have also tested this on the latest version of PHP. Does anyone have any advice on what might be causing this change in behavior?

    Thanks in advance.

    -tparkin

  2. #2
    Junior Member
    Join Date
    Nov 2005
    Posts
    6

    Default

    Just thought this might help illustrate what the real problem is. Here are the HTTP headers from my request. The first are from my local machine, the second is from my shared hosting. You can see that after cURL resolves the 302, it gets the correct document on my local machine but goes to an error page instead on my shared hosting.

    ////////////////////////////////////////////////////////////
    // Local Machine Headers
    ////////////////////////////////////////////////////////////

    HTTP/1.1 302 Moved Temporarily
    Location: https://sahr.cc.ucf.edu/servlets/icl...c=0&adss=true&
    Server: WebLogic 5.1.0 Service Pack 12 04/14/2002 23:14:36 #178459 - 128 bit domestic version
    Content-Length: 529
    Content-Type: text/html
    Set-Cookie: SignOnDefault=; domain=.ucf.edu; expires=Sunday, 11-Jun-2006 19:01:18 GMT; path=/
    Set-Cookie: SAHR3-80-WebLogicSession=RIMt1jW0PsKl484UxL3q1DAQn4OvYdG1CE atGNQC7j9d8JIfa0o5|-8464668797202109986/-2069172281/6/80/80/443/443/80/-1; domain=.ucf.edu; path=/
    Connection: Close

    HTTP/1.1 200 OK
    Server: WebLogic 5.1.0 Service Pack 12 04/14/2002 23:14:36 #178459 - 128 bit domestic version
    Content-Length: 8599
    Content-Type: text/html; CHARSET=UTF-8
    Expires: Thu, 01 Dec 1994 16:00:00 GMT
    Connection: Keep-Alive
    Set-Cookie: SignOnDefault=GUEST; domain=.ucf.edu; expires=Sunday, 11-Jun-2006 19:01:19 GMT; path=/
    Set-Cookie: PS_TOKEN=AAAAmgECAwQAAQAAAAACvAAAAAAAAAAsAARTaGRyA gBOaQgAOAAuADEAMBSVG/BV1yQaBd9S7iJQkVvwZsYesQAAAFoABVNkYXRhTnicRYZLDkAw AAWnJRbiKkSlkXRPaoX4HMIdHc6rBW+SeQNcxmY5Bs3eySWRk5 Gdo9DNxIpJsbKxMHg6WtFTf/ayE4062RHe/nkAKBcKlw==; domain=.ucf.edu; path=/; secure
    Set-Cookie: PS_TOKENEXPIRE=4_Jun_2006_19:01:19_GMT; domain=.ucf.edu; path=/
    Set-Cookie: PS_LOGINLIST=https://sahr.cc.ucf.edu/heprod; domain=.ucf.edu; path=/
    Set-Cookie: ExpirePage=https://sahr.cc.ucf.edu/servlets/iclientservlet/heprod/; domain=.ucf.edu; path=/
    Set-Cookie: SignOnDefault=GUEST; domain=.ucf.edu; expires=Sunday, 11-Jun-2006 19:01:19 GMT; path=/
    Set-Cookie: PS_TOKEN=AAAAmgECAwQAAQAAAAACvAAAAAAAAAAsAARTaGRyA gBOaQgAOAAuADEAMBSVG/BV1yQaBd9S7iJQkVvwZsYesQAAAFoABVNkYXRhTnicRYZLDkAw AAWnJRbiKkSlkXRPaoX4HMIdHc6rBW+SeQNcxmY5Bs3eySWRk5 Gdo9DNxIpJsbKxMHg6WtFTf/ayE4062RHe/nkAKBcKlw==; domain=.ucf.edu; path=/; secure
    Set-Cookie: PS_TOKENEXPIRE=4_Jun_2006_19:01:19_GMT; domain=.ucf.edu; path=/
    Set-Cookie: PS_LOGINLIST=https://sahr.cc.ucf.edu/heprod; domain=.ucf.edu; path=/
    Set-Cookie: ExpirePage=https://sahr.cc.ucf.edu/servlets/iclientservlet/heprod/; domain=.ucf.edu; path=/
    PortalRegisteredURL: https://sahr.cc.ucf.edu/servlets/icl...e=CLASS_SEARCH






    ////////////////////////////////////////////////////////////
    // Shared Hosting Headers
    ////////////////////////////////////////////////////////////

    HTTP/1.1 302 Moved Temporarily
    Location: https://sahr.cc.ucf.edu/servlets/icl...c=0&adss=true&
    Server: WebLogic 5.1.0 Service Pack 12 04/14/2002 23:14:36 #178459 - 128 bit domestic version
    Content-Length: 529
    Content-Type: text/html
    Set-Cookie: SignOnDefault=; domain=.ucf.edu; expires=Sunday, 11-Jun-2006 19:01:50 GMT; path=/
    Set-Cookie: SAHR3-80-WebLogicSession=RIMuHgHu3Q01GZK1An0ac2ueWyO0BCpYKW hhM0nsFuut37EzWMgl|-8464668797202109986/-2069172281/6/80/80/443/443/80/-1; domain=.ucf.edu; path=/
    Connection: Close

    HTTP/1.1 200 OK
    Server: WebLogic 5.1.0 Service Pack 12 04/14/2002 23:14:36 #178459 - 128 bit domestic version
    Content-Length: 5122
    Content-Type: text/html; charset=UTF-8
    Expires: Thu, 01 Dec 1994 16:00:00 GMT
    Connection: Keep-Alive
    Cache-Control: no-store
    Set-Cookie: SignOnDefault=; domain=.ucf.edu; expires=Sunday, 11-Jun-2006 19:01:51 GMT; path=/

  3. #3
    Junior Member
    Join Date
    Nov 2005
    Posts
    6

    Default

    I just tested this with another host and it works fine there. That host is running an older version PHP but has a more recent version of cURL and OpenSSL. I am now certain that this is the problem. Could you please upgrade to the latest version of cURL and OpenSSL? Thanks in advance.

  4. #4
    Ray
    Ray is offline
    I can't do everything.
    Join Date
    Jun 2004
    Location
    Plymouth, WI
    Posts
    134

    Default

    Hello,

    If you could open up a support ticket for this matter, we will gladly investigate the feasibility of upgrading these for you.

    Thanks.
    Ray Tetzloff


  5. #5
    I love LAMP.
    Join Date
    Jul 2004
    Location
    Chicago, Illinois, United States
    Posts
    201

    Default

    I am not sure those headers could be delivered by our shared hosting servers because the server line is wrong. It should read something along the lines of:

    Server: Apache/1.3.34 (Unix) PHP/4.4.2 mod_ssl/2.8.25 OpenSSL/0.9.7a mod_perl/1.29 FrontPage/5.0.2.2635

    Your server responses seem to come from a server that identifies itself as:

    Server: WebLogic 5.1.0 Service Pack 12 04/14/2002 23:14:36 #178459 - 128 bit domestic version

    You might want to double check you're communicating with the right system or looking at the right headers.
    Kevin Stange
    Chief Technology Officer
    Steadfast Networks
    http://steadfast.net
    kevin@steadfast.net

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts