Created
September 6, 2019 10:25
-
-
Save cristiroma/6099505104f7b6a4753f9028d92ec867 to your computer and use it in GitHub Desktop.
Drupal Log in using cURL command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SITE="https://www.website.com" | |
USER="[email protected]" | |
PASS="password" | |
# Log in and save session cookies to cookies.txt | |
curl -c ./cookies.txt -L -X POST $SITE/user/login -d "name=$USER&pass=$PASS&form_id=user_login_form&op=Log In" | |
# Make authenticated requests | |
curl -b cookie.txt -X GET $SITE/admin/config/development/performance |
cookies.txt format
# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
domain.com FALSE / FALSE 0 WSS_KeepSessionAuthenticated {xxx}
domain.com FALSE / FALSE 0 WSS_FullScreenMode false
domain.com FALSE /SitePages FALSE 0 stsSyncIconPath
domain.com FALSE /SitePages FALSE 0 stsSyncAppName Client
domain.com FALSE /SitePages FALSE 0 databaseBtnDesc 0
domain.com FALSE /SitePages FALSE 0 databaseBtnText 0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Raise error