CURL: How retain cookies between requests?

Viewed 1325

I need to login to a page and then submit an entry. i'm able to login with the following code

curl $HOST -s -L -b $COOKIE -c $COOKIE -d "login=submit&login_name=$USER&login_password=$PASS" -o $OUTPUT

but when i try to submit an entry i'm not logged in anymore

curl $HOSTADDNEWS -L -b $COOKIE -c $COOKIE -A $HEADER -d "title=$TITLE" -o $OUTPUT.add.news

How to retain cookies between requests?

1 Answers
Related