Hi - I think this is the correct forum to post this query on, and not the "Sockets and Internet Protocols" one. I did do a quick search, but couldn't find any info on how to achieve this.
We have a service which has a form based login, once you have logged in it sets a cookie and then repeatedly, through out a session, checks to see if the cookie is set. If no cookie is found then it prints the login form. I want to be able to automate the login, so the user does not need to enter any details, and then hand off to the client(browser) to get on with the "session".
I can perform the automated POST successfully (using the org.apache.commons.httpclient package), but I'm having problems with handling the cookies that come back from the website. The cookies need to be set on the clients browser for the service to work. I have tried to grab the cookies that come back to my
servlet, something like:
I can get the cookies no worries, printing them out shows they are there. How do I then forward them on to the browser? - obviously they need to be seen as coming from the domain of the external website, not the domain that my servlet runs on. I tried setting the domain with
, but this doesn't work. Is this possible at all or, because of security issues, is it not going to work? Any help/advice would be much appreciated.