[Pro] PHP, cURL and Cookies

One thing for you to look into here – I don’t think it matters at all what name you give the cookie file, as long as each request references the same file. Earlier in this thread, you mentioned creating a cookie file named for the cookie that you expected to store within it. Those two concepts are not related, as far as I know.

The folder where you create the cookie file needs to exist, and needs to allow whatever user (usually nobody or www-user or something like that) to write into it. A shortcut to this is to give the folder 777 permissions, but this is really something that should not be true for long. (It’s perfectly okay for testing, but leaving a folder at 777 allows anyone else on the same server to read/write that folder, which is bad. )

Once you get the cookie created, look at the folder in Terminal with ls -l, and see which user the file was created with. Then you can chmod the folder to 770, chgroup it to your user’s group, and chown it to that user the Web server runs as. That allows you to change the folder if you need to, and allows the Web server to do the same, but keeps anyone else from accessing it at all.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at: