Last Updated: January 10, 2021
·
32.67K
· jasonseney

Use Curl to Login to a Site with Cookie Sessions

In "batch" (MS DOS) syntax

curl "http://mysite.com/login" ^
    --data-urlencode "rememberMe=true" ^
    --data-urlencode "email=aturing@foobar.com" ^
    --data-urlencode "password=secretpassword" ^
    --cookie "cookies.txt" ^
    --cookie-jar "cookies.txt" ^
    --location ^
    --verbose ^
    > "login_log.html"

curl "http://mysite.com/admin" ^
    --cookie "cookies.txt" ^
    --cookie-jar "cookies.txt" ^
    --head

1 Response
Add your response

Not working to log in into deezer, can u help me at this point? Thanks by the way

over 1 year ago ·