Open xiaolin310 opened 6 months ago
Don't have a suitable environment to test right now, but can you also try with a browser instead of separate curl commands?
The library uses gorilla/sessions to keep track of the session, so my first guess it that fails to work for separate curl commands.
emm..It work indeed in the browser. I find the session info store in browser cookies. I want to use terminal command in my case, so I need a pure memory struct like map to act as the session store.
If you also want memory storage on the client side you can simulate it by saving the received cookies for the first curl command with something like:
curl -c cookies.txt http://example.com
and then reading them from the file and feeding them to the second curl command:
curl -b cookies.txt http://example.com/somepage
This is not tested at all, just giving a vague idea. Might not be suitable for your usecase at all.
If you also want memory storage on the client side you can simulate it by saving the received cookies for the first curl command with something like:
curl -c cookies.txt http://example.com
and then reading them from the file and feeding them to the second curl command:
curl -b cookies.txt http://example.com/somepage
This is not tested at all, just giving a vague idea. Might not be suitable for your usecase at all.
ok, thank you, let me have a try.
Hey, I just run the example, but not work.