How do you handle authentication via cookie with CURL?
May 19, 2005 6:57 PM Subscribe
how do you handle authentication via cookie with CURL?
posted by miniape to computers & internet (8 answers total)
I’ve been assigned a tedious job at work. I wrote a PHP script to do it for me, but it requires CURL, which I’ve never used before. Basically I have to replace text in a file with text from various sources. I’m uploading a set of files to my webhost (company doesn’t use PHP), running the script and outputting them to a separate file. The problem is one of the sources I’m getting data from is the company website, which is password protected. I have a password and username, but I’m not sure how CURL deals with them. Once they’ve been entered, a cookie is stored to save auth status.
Do I just use http://name:firstname.lastname@example.org/full/path/to/file and let CURL handle everything? Or do I have to tell it how to handle the cookie? Or am I not getting this at all?