Please help: Using shell commands to generate login cookie

Hi, I would like to generate the session cookie that I usually get from the login page using the shell. I tried the following

curl --cookie test.txt --cookie-jar test.txt \
-d "user=***name***" \
-d "password=***password***" \
<my nextcloud server>/index.php/login 

which gives me a cookie along the lines

# 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         ..... ...................    

However, when I pass this cookie to my browser and open nextcloud I am not already locked in… what did I miss?

EDIT: moved this to development, as it is not an issue…? Hope to get some help here :slight_smile:

What are you trying to achieve?

Hi Christoph!
i would like to have an auto login script, something along the lines of this https://surf.suckless.org/files/autologin/

I see. Unfortunately I can’t help with this.

Ok, thanks for checking it out :slight_smile: