问题
I would like to generate a login cookie in the shell, before launching my browser, such that I am already logged into certain websites. Currently I am trying this with my own nextcloud server using the following command
curl --cookie test.txt --cookie-jar test.txt \
-d "user=***name***" \
-d "password=***password***" \
<my nextcloud server>/index.php/login
getting a cookie that looks like the following. However, placing this among my other cookies does not allow me to login.
# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
#HttpOnly_<my nextcloud server> FALSE /nextcloud TRUE nc_sameSiteCookiestrict true
#HttpOnly_<my nextcloud server> FALSE /nextcloud TRUE nc_sameSiteCookielax true
#HttpOnly_<my nextcloud server> FALSE /nextcloud TRUE oc_sessionPassphrase .....
#HttpOnly_<my nextcloud server> FALSE /nextcloud TRUE ..... ...................
Recording with chromium the action of a normal login, a different cookie is generated out of the one below, is anyone familiar with this login method? Thanks!
My goal would be an auto login script like this one for the surf browser
来源:https://stackoverflow.com/questions/64704263/generate-login-cookie-in-shell-using-curl