I am having some trouble with the CURL command line. I am trying to send a POST request to an API, which starts a new session. Now, I would like to be in the same session when I make the next request, however when I make another CURL request, it gives me a completely different session.
For example, I make the following request to a server:
curl -v --keepalive --data "username=username&password=password" http://example.com/login
The command above gives me a unique session id of something like
prgl4esck2hu7ge1gustnfgb35
Then I put in another request to a server:
curl -v --keepalive http://example.com/checkLogin
And when I put in the command above into CMD, it gives me a completely different session id. In other words, the session is not persistent and I need it to be persistent. I have no idea what I am doing wrong. Please help, I have been trying to figure this out for hours now. Any help is greatly appreciated!
BTW: This works perfectly fine in Postman, so I know it has to be a problem with the curl request from the command line.