I'm trying to move over a project I used to run on a tomcat server to GAE. I'm using Apache HttpClient, and found some great tips on http://esxx.blogspot.com/2009/06/using-apaches-httpclient-on-google-app.html how to get this running.
After some modificatications (removing the https scheme) I got it running. However, I got some issues with the cookies. The app I'm doing is a proxy between a web client and a web server. The client talks to the proxy, and the proxy fetches data from the web servers with the credentials from the client. So the proxy has to keep track of each clients cookies, so the web servers still thinks the client is logged in. The problem I'm getting revolves around my login sequence, which is a GET, parse response and create a login payload, POST login payload, parse redirect response, GET redirect page, parse response set cookies, GET first page. The problem is that I get two (2) Cookies: and Cookies2: headers in my response to the web server. I see this with Wireshark. This confuses the web server and I get a 500 error from it. I have gone to great length to try to figure out where this happends, and I have tried to disable all cookies. I disabled the response.addHeader(h.getName(), h.getValue()); in @Override public HttpResponse receiveResponseHeader() in GAEClientConnection so when a "Set-Cookie" header comes along its not beeing added, I implemeted a new cookie store that returns a blank ArrayList on getCookies, I removed the this.request.addHeader(new HTTPHeader(h.getName(), h.getValue())); from the @Override public void sendRequestHeader(HttpRequest request) in GAEClientConnection so the cookie header should not be set when creating the sendRequest. Yet the cookies are still there, only now they only appear once. Basically working, but since I can not bind the cookies to a user, I can't use any session management, and only use this sollution for 1 users, not mutiple. So my question is, where exactly does the cookies get added to the request? I have tried to debug this, but I'm lost after the call to ApiProxy.makeSyncCall() in public HTTPResponse fetch(HTTPRequest request) throws IOException { method in URLFetchServiceImpl. So a quick recap, I have problems because I both get my "own" created cookies that I can handle by my own session management, and another set of cookies created by who-know. This is in development mode running local on appengine-java-sdk-1.5.2. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.