2010-06-25 03:51:25 PDT
No idea what you are doing, but works fine here. Also, you want us to do the work for which you are getting paid? Sounds like we'll need to receive a donation here... ;)
Also, if you really are losing your cookie, how could we help with that?
Anyway, this took me like 10 minutes:
#!/bin/sh
SITE="http://localhost:1234"
CURL="curl --cookie-jar cookies --cookie cookies"
USER="psy"
PASS="psy"
NEWUSER="foo"
NEWPASS="bar"
# Log us in
$CURL --data "submitted=1&user=$USER&pass=$PASS" "$SITE/login" -o /dev/null
# Get the CSRF token
CSRF=$($CURL "$SITE/mods/webadmin/adduser" | grep CSRF | cut -f 6 -d \")
# Add user
$CURL --data "_CSRF_Check=$CSRF&submitted=1&newuser=$NEWUSER&password=$NEWPASS&password2=$NEWPASS" "$SITE/mods/webadmin/adduser"