hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: Seeking help using Cookie and Session
Date Wed, 17 Sep 2003 14:56:56 GMT
Before I could give you a more precise answer, I would need some additional input from you.

- What kind of cookie policy have you been using? Have you tried using browser compatibility
  If unsure, you may want to consult our cookie guide:

- What kind of servlet engine are you running on the server?

- Could you produce the wire log of the session in question. 
  Take a look at the logging guide for the instructions on how to activate wire logging:



-----Original Message-----
From: Dan Tran [mailto:danttran@hotmail.com]
Sent: Wednesday, September 17, 2003 4:44 PM
To: Commons HttpClient Project
Subject: Seeking help using Cookie and Session

Hi I am write a small client/server web app to understand more about httpclient/cookie/and

On the httpclient side, I use a get method to keep calling a servlet on server.

    HttpClient client = new HttpClient();
    GetMethod method = new GetMethod(url);
    while ( !done ) {
        if (method.getStatusCode() == HttpStatus.SC_OK) {
        } else {
          System.out.println("Unexpected failure: " +  method.getStatusLine().toString());
          done = true;




on the server side, the doGet() method use this

  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {

The first loop, the client is happy.  I found a cookie in the response.

After that it throws the following warning message in my lo4j

  06:22:37,843 - WARN org.apache.commons.httpclient.HttpMethodBase - Cookie reject
  ed: "$Version=0; JSESSIONID=6D150D24B3D022F9AB835EF4E0AFEC5E; $Path=/webtest". I
  llegal path attribute "/webtest". Path of origin: "http://localhost:8080/webtest   /webgenservlet"

On server side, new session is created for each request

Questions are:

   Why server keeps creating new session instead of reuse the old one?
   What does it mean regarding the Warning.

Advices are greately appreciated.

Happy Coding


To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message