3 Replies - 1109 Views - Last Post: 04 December 2008 - 09:29 PM Rate Topic: -----

#1 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

cURL and cookies

Posted 03 December 2008 - 08:01 PM

I have a script on which I am using cURL to call a website, which leaves a cookie. I need to know how to move that cookie from the server to the users PC.

usually I have at least a general idea of how to do this, and therefore can provide some code... however I have NO idea how to do this with cURL, so any help is greatly appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: cURL and cookies

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5382
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: cURL and cookies

Posted 03 December 2008 - 08:07 PM

What OS is running cURL & what OS is the PC?
Was This Post Helpful? 0
  • +
  • -

#3 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: cURL and cookies

Posted 04 December 2008 - 01:39 PM

um, didn't really think that matters... >_>;

probably Linux for the server (idk what version), and probably Windows XP for the comp

Say for instance I save the cookies into cookie.txt, how would I be able to get them from there into the users computer? and would it even contain the correct domain still? or would it be my site?

This post has been edited by JBrace1990: 04 December 2008 - 06:54 PM

Was This Post Helpful? 0
  • +
  • -

#4 silverblaze  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 69
  • Joined: 18-January 08

Re: cURL and cookies

Posted 04 December 2008 - 09:29 PM

hey JBrace1990,

i dont think it is possible as far as my knowledge goes, because the cookies are browser and site dependent. Usually cUrl stores cookies in the Netscape format.

and also definitely you wont be able to do it with your code because the cookies can only be accessed by the domain which sets it( that is why the cookies are secure :) ).

But one thing you can do is,

You can always read the cookie file that is used by the cURL using a text editor.

Once i came across something similar and what i did is, i used the cURL in my server to get the correct values for the cookies for that account and then i logined to the site from my system using mozilla and when they set the cookies i used a mozilla addon to edit cookies ( many available ), and i set the values maually as the same as tht on the cookie saved by the cURL. It workd like a charm.. But i am not sure wether it vl work on every system or not. :)

hope it helps. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1