Hi All,
I am facing a problem while tring to make a communication between applet and servlet with HttpOlyCookie enabled.

Communication between applet -servlet work's fine when the HttpOnlyCookie property is disabled.

However when the property is enabled the communication between the two breaks.

The problem which is happening is that when the applet send a request the server creates a new session each time due to which a session does not get established between the two.


WebsphereApplicationServer : 6.1

Applet Code (ClientSide):
URL url = new URL(servletURL);
HttpURLConnection httpConn = (HttpURLConnection)url.openConnection();
httpConn.setDoInput (true);
httpConn.setDoOutput (true);
httpConn.setRequestProperty("Cookie", "JSESSIONID="+sessionId);
httpConn.setUseCaches (true);
ObjectInputStream ois= new ObjectInputStream (httpConn.getInputStream ()); //ObjectInputStream object is not getting created and the code throws exception at //this point.
Object obj=ois.readObject();

ServerSide:
ServletOutputStream out = null;
ObjectOutputStream oos = null;
Map map=new HashMap();
map.put("key", "tested");
out = response.getOutputStream();
oos = new ObjectOutputStream(out);
response.setContentType("application/octet-stream");
oos.writeObject(map);

Exception :
java.io.StreamCorruptedException: invalid stream header: 0D0A0D0A