in reply to Cookies write to screen, not to cookie file
You need to understand how cookies and HTTP headers work. The headers contain the cookie and *should* look like:
HTTP/1.1 200 OK Set-Cookie: blah [other headers] Content-Type: text/html <-- Blank line ie \n\n after text/html term +inates header [Form Content Here]
If you see the Cookie as plaintext you have outputted a valid \n\n terminated header *before* you have outputted the Set-Cookie Header. Unbuffer with $|++; at the top of the script, and check the output order. Go to http://web-sniffer.net/ and test your script to see what is being sent in what order. You are getting the order wrong.
cheers
tachyon
|
|---|