Loging into a page on shell with curl

it had been a little bit quite the last time but by now I got a little something you might need to. In my current project I had been running into the problem that I wanted to address a certain Javaservice with a deployment script on the shell. This was the easy part , the even harder part, which took some time talking to uncle google to get an answer, was that this service needed an authentication by a cookie which needs to have a valid session id in it.