Problem on retaining or reusing a http session with the socket

Hi

I have a problem on retaining or reusing a http session with the socket,

first let me clarify myself, the basic concept in my mind is each time when you initiate a connection to a web server there will be a http session associate with it, this session keep trace with the client conversation, is that right?(please correct me if I'm wrong)

with that concept I develop a socket program, the program initiate a http connection with the web server, and send a http GET request (suppose that it get a html file page1.html), the server accept it and response the html code of page1.html, that fine I have no problem with that, now I like to get another page (let said page2.html), so I send another GET request to the web server, but this time the program throw a "java.net.SocketException: Connection closed by remote host" exception.

although the problem could be solve by initiate another connection to get the page2, but the thing is if I do that, then there will be 2 different sessions for each connection instead of same one.

I wonder is there any way to keeping one sessions with multiple time GET or POST request in java socket programming.

if no how can the borwser do that

Any help wil be great appreciate.

[1268 byte] By [AlfredRomeoa] at [2007-11-26 18:49:24]
# 1

after I have read some doc on the web, I found that it seem the session is maintain by the server, it is a job for the web server only, and is nothing to do with the client, (can anyone confirm that?)

another question is, if I want to do a multi GET or POST with the socket, do I have to new or recreate a socket or for each one? if no why it throw a remote host is closed exception when I making another GET/POST request with the same socket instance. (it throw where it try to write on the output stream)

Please help.

AlfredRomeoa at 2007-7-9 6:23:26 > top of Java-index,Core,Core APIs...
# 2
I got it , the answer is just right there http://www.ietf.org/rfc/rfc2109.txt Thanks to google you came and you gave without taking
AlfredRomeoa at 2007-7-9 6:23:26 > top of Java-index,Core,Core APIs...