RE: Cookie problems / strict mode

2004-09-21 Thread Robert Gold
Thanks for the fast reply! 
1) I'm not sure about using already the alpha version. 
3) This is exactly what I didn't want to do, to create my own Get-, Post-
and whatever method.
2) I'll be forced to do it like this even if I didn't want to correct the
'malformed' URL...
But thanks for the http-client anyway it's a very good thing!
Ciao,
Robert.

-Original Message-
From: Oleg Kalnichevski [mailto:@bearingpoint.com] 
Sent: 21 September 2004 15:36
To: [EMAIL PROTECTED]
Subject: Re: Cookie problems / strict mode


Robert,


It is a known problem with HttpClient 2.0. 

There are three possibilities:

(1) Use HttpClient 3.0, which provides fine-grained control over
protocol compliance leniency. 

(2) Disable auto redirect and handle redirects manually

http://jakarta.apache.org/commons/httpclient/redirects.html

(3) Override HttpMethodBase#addCookieRequestHeader() method

protected void addCookieRequestHeader(
  HttpState state, HttpConnection conn)
  throws IOException, HttpException {

  // Clean up the cookie headers
  removeRequestHeader("cookie");

  CookieSpec matcher =
CookiePolicy.getSpecByPolicy(state.getCookiePolicy());
  Cookie[] cookies = matcher.match(conn.getHost(), conn.getPort(),
getPath(), conn.isSecure(), state.getCookies());
  if ((cookies != null) && (cookies.length > 0)) {
getRequestHeaderGroup().addHeader(
  matcher.formatCookieHeader(cookies));
  }
}

Hope this helps

Oleg

On Tue, 2004-09-21 at 12:10, Robert Gold wrote:
> Hi,
> I am using http-client 2.0.1 (1 August 2004). 
> I noticed that lots of websites just accept the cookies to be sent in one
> single line (like sent by IE). This is with http-client just possible in
> strict mode.
> But now I have a webserver which redirects me to an URL which is not
> allowed/valid in strict mode, but at the same time it accepts just the
> cookies send in a single line. 
> 
> I saw a patch from 2003 which allowed the user to add a cookie
> request-header manually. This patch has been removed again from the new
> version? Is there now another technique for that? I don't understand why
> this 'sending of cookies in a single line' must be bound to the strict
mode,
> which has apparently also other impacts.
> 
> It would be very nice if you could give me some help how to solve this
> problem. For me it's either way if I create the cookie-header myself or
it's
> done by the http-client or in whatever way. It just must access this site
> and I don't know how.
> 
> Thanks for help,
> 
> Robert.
> 
> 
> -
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]


***
The information in this email is confidential and may be legally privileged.
Access to this email by anyone other than the intended addressee is
unauthorized.  If you are not the intended recipient of this message, any
review, disclosure, copying, distribution, retention, or any action taken or
omitted to be taken in reliance on it is prohibited and may be unlawful.  If
you are not the intended recipient, please reply to or forward a copy of
this message to the sender and delete the message, any attachments, and any
copies thereof from your system.

***

-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie problems / strict mode

2004-09-21 Thread Oleg Kalnichevski

Robert,


It is a known problem with HttpClient 2.0. 

There are three possibilities:

(1) Use HttpClient 3.0, which provides fine-grained control over
protocol compliance leniency. 

(2) Disable auto redirect and handle redirects manually

http://jakarta.apache.org/commons/httpclient/redirects.html

(3) Override HttpMethodBase#addCookieRequestHeader() method

protected void addCookieRequestHeader(
  HttpState state, HttpConnection conn)
  throws IOException, HttpException {

  // Clean up the cookie headers
  removeRequestHeader("cookie");

  CookieSpec matcher =
CookiePolicy.getSpecByPolicy(state.getCookiePolicy());
  Cookie[] cookies = matcher.match(conn.getHost(), conn.getPort(),
getPath(), conn.isSecure(), state.getCookies());
  if ((cookies != null) && (cookies.length > 0)) {
getRequestHeaderGroup().addHeader(
  matcher.formatCookieHeader(cookies));
  }
}

Hope this helps

Oleg

On Tue, 2004-09-21 at 12:10, Robert Gold wrote:
> Hi,
> I am using http-client 2.0.1 (1 August 2004). 
> I noticed that lots of websites just accept the cookies to be sent in one
> single line (like sent by IE). This is with http-client just possible in
> strict mode.
> But now I have a webserver which redirects me to an URL which is not
> allowed/valid in strict mode, but at the same time it accepts just the
> cookies send in a single line. 
> 
> I saw a patch from 2003 which allowed the user to add a cookie
> request-header manually. This patch has been removed again from the new
> version? Is there now another technique for that? I don't understand why
> this 'sending of cookies in a single line' must be bound to the strict mode,
> which has apparently also other impacts.
> 
> It would be very nice if you could give me some help how to solve this
> problem. For me it's either way if I create the cookie-header myself or it's
> done by the http-client or in whatever way. It just must access this site
> and I don't know how.
> 
> Thanks for help,
> 
> Robert.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

***
The information in this email is confidential and may be legally privileged.  Access 
to this email by anyone other than the intended addressee is unauthorized.  If you are 
not the intended recipient of this message, any review, disclosure, copying, 
distribution, retention, or any action taken or omitted to be taken in reliance on it 
is prohibited and may be unlawful.  If you are not the intended recipient, please 
reply to or forward a copy of this message to the sender and delete the message, any 
attachments, and any copies thereof from your system.
***

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Bug?

2004-05-12 Thread Kalnichevski, Oleg

Duzayak,

'Set-Cookie' (request) header is not the same thing as the 'Cookie' (response) header. 
CookieSpec#formatCookieHeader() method produces a 'Set-Cookie' (request) header, 
whereas CookieSpec#parse() method is intended to parse 'Cookie' (response) headers

I hope this clarifies things a bit

Oleg

-Original Message-
From: Cabbar Duzayak [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 13:47
To: Commons HttpClient Project
Subject: Cookie Bug?


Hi,

I am trying to run the following code for
www.google.com:

Cookie cookie = initialState.getCookies()[0];
CookieSpec cs = CookiePolicy.getDefaultSpec();
Header h = cs.formatCookieHeader(cookie);
Cookie[] cookie2 = cs.parse(cookie.getDomain(), 80,
cookie.getPath(), cookie.getSecure(), h);

And, it is throwing an exception as:

"org.apache.commons.httpclient.cookie.MalformedCookieException:
Cookie name may not start with $"

It looks like h.getValue returns name with $ sign
(which was indeed created by the cookiespec), but the
same cookiespec can not read this back, because it has
a $ sign???

BTW, h.getValue() is:

$Version=0;
PREF=ID=069e080d47cd4332:TM=1084362072:LM=1084362072:S=0u9G4CTYGPvhxJzn;
$Domain=.google.com; $Path=/

Looks like, cookieSpec.parse is expecting the same
string without $ signs, in fact, when I remove dollar
signs manually, the code works fine.

Did I hit the jackpot and found a bug;)

Thanks...





__
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


***
The information in this email is confidential and may be legally privileged.  Access 
to this email by anyone other than the intended addressee is unauthorized.  If you are 
not the intended recipient of this message, any review, disclosure, copying, 
distribution, retention, or any action taken or omitted to be taken in reliance on it 
is prohibited and may be unlawful.  If you are not the intended recipient, please 
reply to or forward a copy of this message to the sender and delete the message, any 
attachments, and any copies thereof from your system.
***

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Visibility Problem from https to http

2004-04-21 Thread Roland Weber
Hello Jean,

are the two links *exactly* the same, apart from the protocol?
In other words, does "somelink" in your examples refer to the
same, fully qualified host name for both links? Does the https
authentication URL really have no path, or did you remove it
to obfuscate sensitive information? Since it's not the secure
flag, my next two guesses would be:

1. mismatching host/domain names
2. mismatching path

As Mike suggested, a wire log would provide us with the
exact definition of the cookie and of the URLs. If you have
to obfuscate the URLs, please keep structural information
intact:

https://our.secret.host/xxx/yyy/login.html

is quite different from

https://hostname/somewhere.html

If the authentication URL you are using is indeed pathless,
you could try again with the path of the authentication page
or servlet.

cheers,
  Roland






"Jean, Victor [IT]" <[EMAIL PROTECTED]>
21.04.2004 18:56
Please respond to "Commons HttpClient Project"
 
To: "Commons HttpClient Project" 
<[EMAIL PROTECTED]>
cc: 
Subject:RE: Cookie Visibility Problem from https to http


Hi Mike, 

Thanks for your response.  I printed out the list of cookies set in 
HttpState and found that all the cookie's secure flags are set to false. I 
also tried adding the same cookie name/value/domain/path with the false 
secure flag without any success.  The http call does not seem to see the 
cookie.  Can you think of any other reasons why the cookie is not visible 
?

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 10:08 PM
To: Commons HttpClient Project
Subject: Re: Cookie Visibility Problem from https to http


Hi Victor,

My guess is that the "secure" flag is being set on this cookie.  This 
flag means that the cookie should only be sent over secure(HTTPS) 
connections.  You can get around this problem by manually adding a new 
cookie (HttpState.addCookie()) with the same values, but setting secure 
to false.  The problem here is that the cookie is set to secure for a 
reason.  My guess is that this cookie contains a session ID that if 
sniffed could be used to gain access to the server as the authenticated 
user.  This may or may not be a concern in your situation.

Mike

On Apr 20, 2004, at 7:07 PM, Jean, Victor [IT] wrote:

> Hello,
>
> I'm having an issue where a cookie set by posting to a https:// link 
> is not being recognized/picked up when i make a http:// call.
>
> I'm using HttpClient and PostMethod to send username/password to be 
> authenticated at the https link.  Once authenticated, a cookie is set 
> by the server and then I make a http call using GetMethod to access 
> the link I need.  However, the http call does not pickup the cookie 
> and I get redirected to authenticate again.  If I make a https get 
> call after the cookie is set, the link works fine in detecting the 
> cookie, the problem is with http calls.  Can someone help by telling 
> me how to make the cookie visible to http when it has been set by 
> https?
>
> Below is my sample code:
>
> //Setup the httpclient
> HttpClient client = new HttpClient();
> client.setTimeout(TIMEOUT);
> client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
>
> Protocol.registerProtocol("https", new Protocol("https",
>  new EasySSLProtocolSocketFactory(), 443));
>
> String authenticationURL = "https://somelink";;
>
> //Post the username/password to the authentication URL
> PostMethod postUserPasswod = new PostMethod(authenticationURL);
> postUserPasswod.setFollowRedirects(true);
> postUserPasswod.addParameter("USER",username);
> postUserPasswod.addParameter("PASSWORD",password);
>
>
> //Execute the Post, If Successful a authentication cookie will 
> be set
> //Then continue executing the request
>
> client.executeMethod(postUserPasswod);
>
>
>  GetMethod requestURL = new GetMethod("
http://somelink/test.html";);
>  client.executeMethod(requestURL );
>  ins = new BufferedInputStream(requestURL 
> .getResponseBodyAsStream());
>
> -
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]




Re: Cookie Visibility Problem from https to http

2004-04-21 Thread Michael Becke
Hi Victor,

That's the only thing that comes to mind immediately.  Please post the 
wire log <http://jakarta.apache.org/commons/httpclient/logging.html> of 
both the requests, and we should be able to figure it out.  Feel free 
to obfuscate any sensitive information in the logs.

Mike

On Apr 21, 2004, at 12:56 PM, Jean, Victor [IT] wrote:

Hi Mike,

Thanks for your response.  I printed out the list of cookies set in 
HttpState and found that all the cookie's secure flags are set to 
false.  I also tried adding the same cookie name/value/domain/path 
with the false secure flag without any success.  The http call does 
not seem to see the cookie.  Can you think of any other reasons why 
the cookie is not visible ?

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 10:08 PM
To: Commons HttpClient Project
Subject: Re: Cookie Visibility Problem from https to http
Hi Victor,

My guess is that the "secure" flag is being set on this cookie.  This
flag means that the cookie should only be sent over secure(HTTPS)
connections.  You can get around this problem by manually adding a new
cookie (HttpState.addCookie()) with the same values, but setting secure
to false.  The problem here is that the cookie is set to secure for a
reason.  My guess is that this cookie contains a session ID that if
sniffed could be used to gain access to the server as the authenticated
user.  This may or may not be a concern in your situation.
Mike

On Apr 20, 2004, at 7:07 PM, Jean, Victor [IT] wrote:

Hello,

I'm having an issue where a cookie set by posting to a https:// link
is not being recognized/picked up when i make a http:// call.
I'm using HttpClient and PostMethod to send username/password to be
authenticated at the https link.  Once authenticated, a cookie is set
by the server and then I make a http call using GetMethod to access
the link I need.  However, the http call does not pickup the cookie
and I get redirected to authenticate again.  If I make a https get
call after the cookie is set, the link works fine in detecting the
cookie, the problem is with http calls.  Can someone help by telling
me how to make the cookie visible to http when it has been set by
https?
Below is my sample code:

 //Setup the httpclient
 HttpClient client = new HttpClient();
 client.setTimeout(TIMEOUT);
 client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
 Protocol.registerProtocol("https", new Protocol("https",
new EasySSLProtocolSocketFactory(), 443));
	 String authenticationURL = "https://somelink";;

//Post the username/password to the authentication URL
PostMethod postUserPasswod = new 
PostMethod(authenticationURL);
postUserPasswod.setFollowRedirects(true);
postUserPasswod.addParameter("USER",username);
postUserPasswod.addParameter("PASSWORD",password);

//Execute the Post, If Successful a authentication cookie will
be set
//Then continue executing the request
client.executeMethod(postUserPasswod);

  GetMethod requestURL = new GetMethod("http://somelink/test.html";);
  client.executeMethod(requestURL );
  ins = new BufferedInputStream(requestURL
.getResponseBodyAsStream());
-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Cookie Visibility Problem from https to http

2004-04-21 Thread Jean, Victor [IT]
Hi Mike, 

Thanks for your response.  I printed out the list of cookies set in HttpState and 
found that all the cookie's secure flags are set to false.  I also tried adding the 
same cookie name/value/domain/path with the false secure flag without any success.  
The http call does not seem to see the cookie.  Can you think of any other reasons why 
the cookie is not visible ?

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 10:08 PM
To: Commons HttpClient Project
Subject: Re: Cookie Visibility Problem from https to http


Hi Victor,

My guess is that the "secure" flag is being set on this cookie.  This 
flag means that the cookie should only be sent over secure(HTTPS) 
connections.  You can get around this problem by manually adding a new 
cookie (HttpState.addCookie()) with the same values, but setting secure 
to false.  The problem here is that the cookie is set to secure for a 
reason.  My guess is that this cookie contains a session ID that if 
sniffed could be used to gain access to the server as the authenticated 
user.  This may or may not be a concern in your situation.

Mike

On Apr 20, 2004, at 7:07 PM, Jean, Victor [IT] wrote:

> Hello,
>
> I'm having an issue where a cookie set by posting to a https:// link 
> is not being recognized/picked up when i make a http:// call.
>
> I'm using HttpClient and PostMethod to send username/password to be 
> authenticated at the https link.  Once authenticated, a cookie is set 
> by the server and then I make a http call using GetMethod to access 
> the link I need.  However, the http call does not pickup the cookie 
> and I get redirected to authenticate again.  If I make a https get 
> call after the cookie is set, the link works fine in detecting the 
> cookie, the problem is with http calls.  Can someone help by telling 
> me how to make the cookie visible to http when it has been set by 
> https?
>
> Below is my sample code:
>
>//Setup the httpclient
>HttpClient client = new HttpClient();
>client.setTimeout(TIMEOUT);
>client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
>
>Protocol.registerProtocol("https", new Protocol("https",
>   new EasySSLProtocolSocketFactory(), 443));
>
>String authenticationURL = "https://somelink";;
>
> //Post the username/password to the authentication URL
> PostMethod postUserPasswod = new PostMethod(authenticationURL);
> postUserPasswod.setFollowRedirects(true);
> postUserPasswod.addParameter("USER",username);
> postUserPasswod.addParameter("PASSWORD",password);
>
>
> //Execute the Post, If Successful a authentication cookie will 
> be set
> //Then continue executing the request
>
> client.executeMethod(postUserPasswod);
>
>
> GetMethod requestURL = new GetMethod("http://somelink/test.html";);
> client.executeMethod(requestURL );
> ins = new BufferedInputStream(requestURL 
> .getResponseBodyAsStream());
>
> -
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Visibility Problem from https to http

2004-04-20 Thread Michael Becke
Hi Victor,

My guess is that the "secure" flag is being set on this cookie.  This 
flag means that the cookie should only be sent over secure(HTTPS) 
connections.  You can get around this problem by manually adding a new 
cookie (HttpState.addCookie()) with the same values, but setting secure 
to false.  The problem here is that the cookie is set to secure for a 
reason.  My guess is that this cookie contains a session ID that if 
sniffed could be used to gain access to the server as the authenticated 
user.  This may or may not be a concern in your situation.

Mike

On Apr 20, 2004, at 7:07 PM, Jean, Victor [IT] wrote:

Hello,

I'm having an issue where a cookie set by posting to a https:// link 
is not being recognized/picked up when i make a http:// call.

I'm using HttpClient and PostMethod to send username/password to be 
authenticated at the https link.  Once authenticated, a cookie is set 
by the server and then I make a http call using GetMethod to access 
the link I need.  However, the http call does not pickup the cookie 
and I get redirected to authenticate again.  If I make a https get 
call after the cookie is set, the link works fine in detecting the 
cookie, the problem is with http calls.  Can someone help by telling 
me how to make the cookie visible to http when it has been set by 
https?

Below is my sample code:

 //Setup the httpclient
 HttpClient client = new HttpClient();
 client.setTimeout(TIMEOUT);
 client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
 Protocol.registerProtocol("https", new Protocol("https",
new EasySSLProtocolSocketFactory(), 443));
	 String authenticationURL = "https://somelink";;

//Post the username/password to the authentication URL
PostMethod postUserPasswod = new PostMethod(authenticationURL);
postUserPasswod.setFollowRedirects(true);
postUserPasswod.addParameter("USER",username);
postUserPasswod.addParameter("PASSWORD",password);
//Execute the Post, If Successful a authentication cookie will 
be set
//Then continue executing the request

client.executeMethod(postUserPasswod);

	  GetMethod requestURL = new GetMethod("http://somelink/test.html";);
	  client.executeMethod(requestURL );
	  ins = new BufferedInputStream(requestURL 
.getResponseBodyAsStream());

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: cookie version info

2004-03-19 Thread Kalnichevski, Oleg
--- Begin Message ---
Kazuya,
Per default HttpClient uses very strict RFC2109 compliant cookie spec, which requires 
all cookies to have a version attribute. Those cookies that do not have an explicit 
version attribute are assumed to be of version 0 (formatted according to the Netscape 
cookie draft)

As to IE not using the version attribute, well, this so called browser has been 
developed by one very innovative company, which likes to innovate especially when it 
comes to standards compliance.

If you want HttpClient to be simulate the behaviour of mainstream browsers, use 
Browser compatibility cookie spec

For more details please refer to HttpClient cookies guide 


Oleg

-Original Message-
From:   Imabayashi, Kazuya [mailto:[EMAIL PROTECTED]
Sent:   Fri 3/19/2004 08:56
To: Commons HttpClient Project
Cc: 
Subject:cookie version info
Hi there,

I have a small question regarding cookie handling.
When I execute GetMethod to some host, cookies are returned.
However, each cookie has its version info, like "$version=0".
An application of the target host cannot process this properly.
When I took some http traces via IE, no version info specified.

Does anybody have any idea on this?

Regards,
Kazuya Imabayashi




<>--- End Message ---
***
The information in this email is confidential and may be legally privileged.  Access 
to this email by anyone other than the intended addressee is unauthorized.  If you are 
not the intended recipient of this message, any review, disclosure, copying, 
distribution, retention, or any action taken or omitted to be taken in reliance on it 
is prohibited and may be unlawful.  If you are not the intended recipient, please 
reply to or forward a copy of this message to the sender and delete the message, any 
attachments, and any copies thereof from your system.
***
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: cookie version info

2004-03-19 Thread Imabayashi, Kazuya
Thanks for your support.
I tested to get cookies from public sites such as amazon.com and I noticed the no 
version is specified in "COMPATIBILITY" mode. I don't have an access to the concerned 
system right now. I thought I used it but I will check it again. By the way, problem 
occurred at application side. It is ASP application and it tires to use CInt function 
to convert received cookie to integer but error occurred because "$version=0" was 
included in it. 
Thanks again
Kazuya Imabayashi

-Original Message-
From: Roland Weber [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 19, 2004 5:39 PM
To: Commons HttpClient Project
Subject: RE: cookie version info

Hello,

I can't tell for what reasons IE behaves as it does.

Cookies with version 0 are always formatted using CookiePolicy.NETSCAPE. You can 
search for the cookie in the HttpState, then use setVersion() to change the version 
number. Then, the cookie will be formatted by the default CookiePolicy, which you can 
replace. That's for the HttpClient version in CVS HEAD.

When thinking about it, this sounds a lot like a hack.
I wonder why the application sends a Netscape style cookie if it can't handle it when 
it comes back. Or maybe the application does *not* send a Netscape style cookie, but 
fails to provide appropriate version info.
Kayzuya, which version of HttpClient are you using?
And could you post a wire log, so we can see what cookie headers are actually received 
from and sent back to the server?

http://jakarta.apache.org/commons/httpclient/logging.html

cheers,
  Roland






"Imabayashi, Kazuya" <[EMAIL PROTECTED]>
19.03.2004 09:26
Please respond to "Commons HttpClient Project"
 
To: "'Commons HttpClient Project'" 
<[EMAIL PROTECTED]>
cc: 
Subject:RE: cookie version info


Thanks a lot for your reply.
Then why IE does not pass it to server? Is there any way to strip it off using 
httpclient? 
Regards,
Kazuya Imabayashi

-Original Message-
From: Roland Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, March 19, 2004 5:16 PM
To: Commons HttpClient Project
Subject: Re: cookie version info

Hello,

there are two versions of the Cookie spec, the old one (RFC 2109) and the new one (RFC 
2965). Cookies that adhere to the new spec include version info when sent back to the 
server. RFC 2965 also includes information about compatibility with older servers.

http://www.ietf.org/rfc/rfc2965.txt

My guess is that the server supports the new cookies, but the application running on 
the server does not.

cheers,
  Roland






"Imabayashi, Kazuya" <[EMAIL PROTECTED]>
19.03.2004 08:56
Please respond to "Commons HttpClient Project"
 
To: Commons HttpClient Project 
<[EMAIL PROTECTED]>
cc: 
Subject:cookie version info


Hi there,

I have a small question regarding cookie handling.
When I execute GetMethod to some host, cookies are returned.
However, each cookie has its version info, like "$version=0".
An application of the target host cannot process this properly.
When I took some http traces via IE, no version info specified.

Does anybody have any idea on this?

Regards,
Kazuya Imabayashi



-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: cookie version info

2004-03-19 Thread Roland Weber
Hello,

I can't tell for what reasons IE behaves as it does.

Cookies with version 0 are always formatted using
CookiePolicy.NETSCAPE. You can search for the
cookie in the HttpState, then use setVersion() to
change the version number. Then, the cookie will
be formatted by the default CookiePolicy, which
you can replace. That's for the HttpClient version
in CVS HEAD.

When thinking about it, this sounds a lot like a hack.
I wonder why the application sends a Netscape style
cookie if it can't handle it when it comes back. Or
maybe the application does *not* send a Netscape
style cookie, but fails to provide appropriate version
info.
Kayzuya, which version of HttpClient are you using?
And could you post a wire log, so we can see what
cookie headers are actually received from and sent
back to the server?

http://jakarta.apache.org/commons/httpclient/logging.html

cheers,
  Roland






"Imabayashi, Kazuya" <[EMAIL PROTECTED]>
19.03.2004 09:26
Please respond to "Commons HttpClient Project"
 
To: "'Commons HttpClient Project'" 
<[EMAIL PROTECTED]>
cc: 
Subject:RE: cookie version info


Thanks a lot for your reply.
Then why IE does not pass it to server? Is there any way to strip it off 
using httpclient? 
Regards,
Kazuya Imabayashi

-Original Message-
From: Roland Weber [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 19, 2004 5:16 PM
To: Commons HttpClient Project
Subject: Re: cookie version info

Hello,

there are two versions of the Cookie spec, the old one (RFC 2109) and the 
new one (RFC 2965). Cookies that adhere to the new spec include version 
info when sent back to the server. RFC 2965 also includes information 
about compatibility with older servers.

http://www.ietf.org/rfc/rfc2965.txt

My guess is that the server supports the new cookies, but the application 
running on the server does not.

cheers,
  Roland






"Imabayashi, Kazuya" <[EMAIL PROTECTED]>
19.03.2004 08:56
Please respond to "Commons HttpClient Project"
 
To: Commons HttpClient Project 
<[EMAIL PROTECTED]>
cc: 
Subject:cookie version info


Hi there,

I have a small question regarding cookie handling.
When I execute GetMethod to some host, cookies are returned.
However, each cookie has its version info, like "$version=0".
An application of the target host cannot process this properly.
When I took some http traces via IE, no version info specified.

Does anybody have any idea on this?

Regards,
Kazuya Imabayashi



-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]




RE: cookie version info

2004-03-19 Thread Imabayashi, Kazuya
Thanks a lot for your reply.
Then why IE does not pass it to server? Is there any way to strip it off using 
httpclient? 
Regards,
Kazuya Imabayashi

-Original Message-
From: Roland Weber [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 19, 2004 5:16 PM
To: Commons HttpClient Project
Subject: Re: cookie version info

Hello,

there are two versions of the Cookie spec, the old one (RFC 2109) and the new one (RFC 
2965). Cookies that adhere to the new spec include version info when sent back to the 
server. RFC 2965 also includes information about compatibility with older servers.

http://www.ietf.org/rfc/rfc2965.txt

My guess is that the server supports the new cookies, but the application running on 
the server does not.

cheers,
  Roland






"Imabayashi, Kazuya" <[EMAIL PROTECTED]>
19.03.2004 08:56
Please respond to "Commons HttpClient Project"
 
To: Commons HttpClient Project 
<[EMAIL PROTECTED]>
cc: 
Subject:cookie version info


Hi there,

I have a small question regarding cookie handling.
When I execute GetMethod to some host, cookies are returned.
However, each cookie has its version info, like "$version=0".
An application of the target host cannot process this properly.
When I took some http traces via IE, no version info specified.

Does anybody have any idea on this?

Regards,
Kazuya Imabayashi



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cookie version info

2004-03-19 Thread Roland Weber
Hello,

there are two versions of the Cookie spec, the old one
(RFC 2109) and the new one (RFC 2965). Cookies that
adhere to the new spec include version info when sent
back to the server. RFC 2965 also includes information
about compatibility with older servers.

http://www.ietf.org/rfc/rfc2965.txt

My guess is that the server supports the new cookies,
but the application running on the server does not.

cheers,
  Roland






"Imabayashi, Kazuya" <[EMAIL PROTECTED]>
19.03.2004 08:56
Please respond to "Commons HttpClient Project"
 
To: Commons HttpClient Project 
<[EMAIL PROTECTED]>
cc: 
Subject:cookie version info


Hi there,

I have a small question regarding cookie handling.
When I execute GetMethod to some host, cookies are returned.
However, each cookie has its version info, like "$version=0".
An application of the target host cannot process this properly.
When I took some http traces via IE, no version info specified.

Does anybody have any idea on this?

Regards,
Kazuya Imabayashi




RE: Cookie rejected problem

2004-02-24 Thread Xavier Frisaye
You're absolutely right, Roland, i was about sure about it but with your
confirmation, there is no doubt.

Thank you for your reply

-Original Message-
From: Roland Weber [mailto:[EMAIL PROTECTED]
Sent: mardi 24 fevrier 2004 13:05
To: Commons HttpClient Project
Subject: Re: Cookie rejected problem


Hello Xavier,

your first action should be to contact the administrator of
that web site and tell him that the cookie configuration is
all screwed up.
No browser should accept a cookie for .smals-mvm.be
coming from socialsecurity.be, let alone HttpClient. It
would be a security violation to do so.

Next, you should check whether you need the cookie at all.
I doubt there are many browsers that fail to filter that
cookie. So the site may work without it.

Finally, you can implement your own InsecureGetMethod,
derived from GetMethod, where you override the method
processResponseHeaders. Then you create a cookie that
has the originating domain instead of the invalid domain,
and add that cookie to the state.

cheers,
  Roland








"Xavier Frisaye" <[EMAIL PROTECTED]>
24.02.2004 12:33
Please respond to "Commons HttpClient Project"
 
To: "Commons HttpClient Project" 
<[EMAIL PROTECTED]>
cc: 
Subject:Cookie rejected problem


Hi all,
I'm using httpclient 2.0 and i'm encountering this problem when i try to
connect to
https://www.socialsecurity.be/login/login_fr?j_target_url=%2Fsrd%2Findex
.jsp using a get method :

24-fevr.-2004 11:58:35 org.apache.commons.httpclient.HttpMethodBase
processResponseHeaders 
ATTENTION: Cookie rejected:
"JSESSIONID=A7vh20mc7kV8j1gNcy0utYApOrPTzn2ZLLbX2zeY633eHw1xw5If!1167850
366!freyr.smals-mvm.be!8090!-1". Illegal domain attribute
".smals-mvm.be". Domain of origin: "socialsecurity.be"

I know this is a security/policy cookie problem and i try all available
cookie policies but it doesn't work...

Does anyone have a solution for this?

Thanks a lot

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie rejected problem

2004-02-24 Thread Roland Weber
Hello Xavier,

your first action should be to contact the administrator of
that web site and tell him that the cookie configuration is
all screwed up.
No browser should accept a cookie for .smals-mvm.be
coming from socialsecurity.be, let alone HttpClient. It
would be a security violation to do so.

Next, you should check whether you need the cookie at all.
I doubt there are many browsers that fail to filter that
cookie. So the site may work without it.

Finally, you can implement your own InsecureGetMethod,
derived from GetMethod, where you override the method
processResponseHeaders. Then you create a cookie that
has the originating domain instead of the invalid domain,
and add that cookie to the state.

cheers,
  Roland








"Xavier Frisaye" <[EMAIL PROTECTED]>
24.02.2004 12:33
Please respond to "Commons HttpClient Project"
 
To: "Commons HttpClient Project" 
<[EMAIL PROTECTED]>
cc: 
Subject:Cookie rejected problem


Hi all,
I'm using httpclient 2.0 and i'm encountering this problem when i try to
connect to
https://www.socialsecurity.be/login/login_fr?j_target_url=%2Fsrd%2Findex
.jsp using a get method :

24-fevr.-2004 11:58:35 org.apache.commons.httpclient.HttpMethodBase
processResponseHeaders 
ATTENTION: Cookie rejected:
"JSESSIONID=A7vh20mc7kV8j1gNcy0utYApOrPTzn2ZLLbX2zeY633eHw1xw5If!1167850
366!freyr.smals-mvm.be!8090!-1". Illegal domain attribute
".smals-mvm.be". Domain of origin: "socialsecurity.be"

I know this is a security/policy cookie problem and i try all available
cookie policies but it doesn't work...

Does anyone have a solution for this?

Thanks a lot

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]




RE: Cookie Problem

2004-02-16 Thread hareesh babu
Kalnichevski, Oleg

 I modified the HttpClient 2.0-RC3 code of
HeaderElement code to stop prasing by token by ",". 
then i am able to get the cookie as of requirement. 

Thanks
Hareesh.

 --- "Kalnichevski, Oleg"
<[EMAIL PROTECTED]> wrote: > By
definition entity enclosing methods MAY NOT
> automatically handle redirects. Make sure you do not
> attempt to set setFollowRedirects to true on POST or
> PUT methods.
> 
> Oleg
> 
> -Original Message-
> From: hareesh babu [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 17:19
> To: Commons HttpClient Project
> Subject: RE: Cookie Problem
> 
> 
> Kalnichevski, Oleg,
> 
> For this reason, i download the lastest build from
> cvs
> of 20040215.zip.
> Then i am getting this expection. But this code some
> sort with httpclinet 2.0 rc3 version.
> 
> java.lang.IllegalArgumentException: Entity enclosing
> requests cannot be redirected without user
> intervention
>  [java]   at
>
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:239)
>  [java]   at Test1.main(Test1.java:127)
>  [java] Exception in thread "main" 
> 
> Hareesh.
> 
>  --- "Kalnichevski, Oleg"
> <[EMAIL PROTECTED]> wrote: > Hi
> Hareesh,
> > 
> > None of the cookie specs in the stable (HttpClient
> > 2.0) branch can handle malformed cookies with
> > unescaped commas. The development branch
> (HttpClient
> > 3.0-pre-alpha) contains an improved Netscape
> cookie
> > spec capable of handling commas in cookie values.
> > For more details on the problem refer to the bug
> > report below:
> > 
> >
>
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11240
> > 
> > Oleg
> > 
> > -Original Message-
> > From: hareesh babu [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 16, 2004 13:37
> > To: Commons HttpClient Project
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: Cookie Problem
> > 
> > 
> > Hi  Roland Weber,
> > 
> >   Thanks for you immediate reponse. Even if set
> the
> > cookie policy by different i am getting the
> problem.
> > 
> > Let me explain the problem i am facing, I am
> sending
> > a
> > get request the home page of the xxx website, it
> is
> > comming fine, after that i am sending a post with
> > user
> > and password, and that is also comming after that
> if
> > send a another get request in the internal site
> > which
> > requies authorized user, website is checking the
> > cookie, but the cookie problem, the website is
> > redirecting the request into home page one agian. 
> > I try do by removing the SEPARATORS.set(',');  in
> > the
> > HeaderElement, no use. 
> >   
> > Here i placing my sample request program
> > 
> > *
> > 
> > import java.io.IOException;
> > import java.net.MalformedURLException;
> > import org.apache.commons.httpclient.Credentials;
> > import
> >
>
org.apache.commons.httpclient.UsernamePasswordCredentials;
> > import org.apache.commons.httpclient.Header;
> > import org.apache.commons.httpclient.HttpClient;
> > import
> org.apache.commons.httpclient.HttpException;
> > import org.apache.commons.httpclient.HttpMethod;
> > import org.apache.commons.httpclient.Cookie;
> > import
> > org.apache.commons.httpclient.cookie.CookiePolicy;
> > import
> > org.apache.commons.httpclient.methods.GetMethod;
> > import
> > org.apache.commons.httpclient.methods.PostMethod;
> > import
> org.apache.commons.httpclient.NameValuePair;
> > import org.apache.commons.httpclient.Header;
> > 
> > 
> > public class Test1
> > {
> > 
> >  public static void main(String[] args) throws
> > Exception
> > {
> >
> >
> System.setProperty("org.apache.commons.logging.Log",
> > "org.apache.commons.logging.impl.SimpleLog");
> >
> >
>
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
> > "true");
> >
> >
>
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
> > "debug");
> >
> >
>
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
> > "debug");
> >   
> > 
> > //create a singular HttpClient object
> > String HOST =".xxx.

RE: Cookie Problem

2004-02-16 Thread Kalnichevski, Oleg
By definition entity enclosing methods MAY NOT automatically handle redirects. Make 
sure you do not attempt to set setFollowRedirects to true on POST or PUT methods.

Oleg

-Original Message-
From: hareesh babu [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 17:19
To: Commons HttpClient Project
Subject: RE: Cookie Problem


Kalnichevski, Oleg,

For this reason, i download the lastest build from cvs
of 20040215.zip.
Then i am getting this expection. But this code some
sort with httpclinet 2.0 rc3 version.

java.lang.IllegalArgumentException: Entity enclosing
requests cannot be redirected without user
intervention
 [java] at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:239)
 [java] at Test1.main(Test1.java:127)
 [java] Exception in thread "main" 

Hareesh.

 --- "Kalnichevski, Oleg"
<[EMAIL PROTECTED]> wrote: > Hi
Hareesh,
> 
> None of the cookie specs in the stable (HttpClient
> 2.0) branch can handle malformed cookies with
> unescaped commas. The development branch (HttpClient
> 3.0-pre-alpha) contains an improved Netscape cookie
> spec capable of handling commas in cookie values.
> For more details on the problem refer to the bug
> report below:
> 
>
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11240
> 
> Oleg
> 
> -Original Message-
> From: hareesh babu [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 13:37
> To: Commons HttpClient Project
> Cc: [EMAIL PROTECTED]
> Subject: Re: Cookie Problem
> 
> 
> Hi  Roland Weber,
> 
>   Thanks for you immediate reponse. Even if set the
> cookie policy by different i am getting the problem.
> 
> Let me explain the problem i am facing, I am sending
> a
> get request the home page of the xxx website, it is
> comming fine, after that i am sending a post with
> user
> and password, and that is also comming after that if
> send a another get request in the internal site
> which
> requies authorized user, website is checking the
> cookie, but the cookie problem, the website is
> redirecting the request into home page one agian. 
> I try do by removing the SEPARATORS.set(',');  in
> the
> HeaderElement, no use. 
>   
> Here i placing my sample request program
> 
> *
> 
> import java.io.IOException;
> import java.net.MalformedURLException;
> import org.apache.commons.httpclient.Credentials;
> import
>
org.apache.commons.httpclient.UsernamePasswordCredentials;
> import org.apache.commons.httpclient.Header;
> import org.apache.commons.httpclient.HttpClient;
> import org.apache.commons.httpclient.HttpException;
> import org.apache.commons.httpclient.HttpMethod;
> import org.apache.commons.httpclient.Cookie;
> import
> org.apache.commons.httpclient.cookie.CookiePolicy;
> import
> org.apache.commons.httpclient.methods.GetMethod;
> import
> org.apache.commons.httpclient.methods.PostMethod;
> import org.apache.commons.httpclient.NameValuePair;
> import org.apache.commons.httpclient.Header;
> 
> 
> public class Test1
> {
> 
>  public static void main(String[] args) throws
> Exception
> {
>
> System.setProperty("org.apache.commons.logging.Log",
> "org.apache.commons.logging.impl.SimpleLog");
>
>
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
> "true");
>
>
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
> "debug");
>
>
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
> "debug");
>   
> 
> //create a singular HttpClient object
> String HOST =".xxx.com";
> int PORT = 80;
> 
> HttpClient client = new HttpClient();
> client.getHostConfiguration().setHost(HOST,
> PORT, "http");
> client.getState().setCookiePolicy(
> CookiePolicy.COMPATIBILITY );
> 
> 
> String url = "/online/on_login1.jsp";
> GetMethod getMethod = null;
> Header header1 = new Header ("Accept",
> "image/gif, image/x-xbitmap, image/jpeg,
> image/pjpeg,
> application/msword, */*");
> Header header2 = new Header ("Referer",
> "http://"; + HOST);
> Header header3 = new Header
> ("Accept-Language", "en-us");
> Header header4 = new Header 
> ("Content-Type",
> "application/x-www-form-urlencoded");
> Header header5 = new Header
> ("Accept-Encoding", "gzip, deflat

RE: Cookie Problem

2004-02-16 Thread hareesh babu
Kalnichevski, Oleg,

For this reason, i download the lastest build from cvs
of 20040215.zip.
Then i am getting this expection. But this code some
sort with httpclinet 2.0 rc3 version.

java.lang.IllegalArgumentException: Entity enclosing
requests cannot be redirected without user
intervention
 [java] at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:239)
 [java] at Test1.main(Test1.java:127)
 [java] Exception in thread "main" 

Hareesh.

 --- "Kalnichevski, Oleg"
<[EMAIL PROTECTED]> wrote: > Hi
Hareesh,
> 
> None of the cookie specs in the stable (HttpClient
> 2.0) branch can handle malformed cookies with
> unescaped commas. The development branch (HttpClient
> 3.0-pre-alpha) contains an improved Netscape cookie
> spec capable of handling commas in cookie values.
> For more details on the problem refer to the bug
> report below:
> 
>
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11240
> 
> Oleg
> 
> -Original Message-
> From: hareesh babu [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 13:37
> To: Commons HttpClient Project
> Cc: [EMAIL PROTECTED]
> Subject: Re: Cookie Problem
> 
> 
> Hi  Roland Weber,
> 
>   Thanks for you immediate reponse. Even if set the
> cookie policy by different i am getting the problem.
> 
> Let me explain the problem i am facing, I am sending
> a
> get request the home page of the xxx website, it is
> comming fine, after that i am sending a post with
> user
> and password, and that is also comming after that if
> send a another get request in the internal site
> which
> requies authorized user, website is checking the
> cookie, but the cookie problem, the website is
> redirecting the request into home page one agian. 
> I try do by removing the SEPARATORS.set(',');  in
> the
> HeaderElement, no use. 
>   
> Here i placing my sample request program
> 
> *
> 
> import java.io.IOException;
> import java.net.MalformedURLException;
> import org.apache.commons.httpclient.Credentials;
> import
>
org.apache.commons.httpclient.UsernamePasswordCredentials;
> import org.apache.commons.httpclient.Header;
> import org.apache.commons.httpclient.HttpClient;
> import org.apache.commons.httpclient.HttpException;
> import org.apache.commons.httpclient.HttpMethod;
> import org.apache.commons.httpclient.Cookie;
> import
> org.apache.commons.httpclient.cookie.CookiePolicy;
> import
> org.apache.commons.httpclient.methods.GetMethod;
> import
> org.apache.commons.httpclient.methods.PostMethod;
> import org.apache.commons.httpclient.NameValuePair;
> import org.apache.commons.httpclient.Header;
> 
> 
> public class Test1
> {
> 
>  public static void main(String[] args) throws
> Exception
> {
>
> System.setProperty("org.apache.commons.logging.Log",
> "org.apache.commons.logging.impl.SimpleLog");
>
>
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
> "true");
>
>
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
> "debug");
>
>
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
> "debug");
>   
> 
> //create a singular HttpClient object
> String HOST =".xxx.com";
> int PORT = 80;
> 
> HttpClient client = new HttpClient();
> client.getHostConfiguration().setHost(HOST,
> PORT, "http");
> client.getState().setCookiePolicy(
> CookiePolicy.COMPATIBILITY );
> 
> 
> String url = "/online/on_login1.jsp";
> GetMethod getMethod = null;
> Header header1 = new Header ("Accept",
> "image/gif, image/x-xbitmap, image/jpeg,
> image/pjpeg,
> application/msword, */*");
> Header header2 = new Header ("Referer",
> "http://"; + HOST);
> Header header3 = new Header
> ("Accept-Language", "en-us");
> Header header4 = new Header 
> ("Content-Type",
> "application/x-www-form-urlencoded");
> Header header5 = new Header
> ("Accept-Encoding", "gzip, deflate");
> Header header6 = new Header
> ("Proxy-Connection", "Keep-Alive");
> Header header7 = new Header ("Pragma",
> "no-cache");
> Header header8 = new Header ("Cookie",
> "name=Online");
> 
> getMethod = new GetMethod(ur

RE: Cookie Problem

2004-02-16 Thread Kalnichevski, Oleg
Hi Hareesh,

None of the cookie specs in the stable (HttpClient 2.0) branch can handle malformed 
cookies with unescaped commas. The development branch (HttpClient 3.0-pre-alpha) 
contains an improved Netscape cookie spec capable of handling commas in cookie values. 
For more details on the problem refer to the bug report below:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11240

Oleg

-Original Message-
From: hareesh babu [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 13:37
To: Commons HttpClient Project
Cc: [EMAIL PROTECTED]
Subject: Re: Cookie Problem


Hi  Roland Weber,

  Thanks for you immediate reponse. Even if set the
cookie policy by different i am getting the problem. 
Let me explain the problem i am facing, I am sending a
get request the home page of the xxx website, it is
comming fine, after that i am sending a post with user
and password, and that is also comming after that if
send a another get request in the internal site which
requies authorized user, website is checking the
cookie, but the cookie problem, the website is
redirecting the request into home page one agian. 
I try do by removing the SEPARATORS.set(',');  in the
HeaderElement, no use. 
  
Here i placing my sample request program

*

import java.io.IOException;
import java.net.MalformedURLException;
import org.apache.commons.httpclient.Credentials;
import
org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.Cookie;
import
org.apache.commons.httpclient.cookie.CookiePolicy;
import
org.apache.commons.httpclient.methods.GetMethod;
import
org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.Header;


public class Test1
{

 public static void main(String[] args) throws
Exception
{
   
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
   
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
"true");
   
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
"debug");
   
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
  

//create a singular HttpClient object
String HOST =".xxx.com";
int PORT = 80;

HttpClient client = new HttpClient();
client.getHostConfiguration().setHost(HOST,
PORT, "http");
client.getState().setCookiePolicy(
CookiePolicy.COMPATIBILITY );


String url = "/online/on_login1.jsp";
GetMethod getMethod = null;
Header header1 = new Header ("Accept",
"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, */*");
Header header2 = new Header ("Referer",
"http://"; + HOST);
Header header3 = new Header
("Accept-Language", "en-us");
Header header4 = new Header  ("Content-Type",
"application/x-www-form-urlencoded");
Header header5 = new Header
("Accept-Encoding", "gzip, deflate");
Header header6 = new Header
("Proxy-Connection", "Keep-Alive");
Header header7 = new Header ("Pragma",
"no-cache");
Header header8 = new Header ("Cookie",
"name=Online");

getMethod = new GetMethod(url);
getMethod.setFollowRedirects(true);
getMethod.setStrictMode(false);
getMethod.setRequestHeader(header1);
getMethod.setRequestHeader(header2);
getMethod.setRequestHeader(header3);
getMethod.setRequestHeader(header4);
getMethod.setRequestHeader(header5);
getMethod.setRequestHeader(header6);
getMethod.setRequestHeader(header7);
getMethod.setRequestHeader(header8);

//execute the method
String responseBody = null;
try{
client.executeMethod(getMethod);
responseBody =
getMethod.getResponseBodyAsString();
} catch (HttpException he) {
System.err.println("Http error connecting
to '" + url + "'");
System.err.println(he.getMessage());
System.exit(-4);
} catch (IOException ioe){
System.err.println("Unable to connect to
'" + url + "'");
System.exit(-3);
}

Cookie[] logoncookies =
client.getState().getCookies(HOST, PORT, "/", false);
System.out.println("First Request Cookies");
if (log

Re: Cookie Problem

2004-02-16 Thread hareesh babu
Hi  Roland Weber,

  Thanks for you immediate reponse. Even if set the
cookie policy by different i am getting the problem. 
Let me explain the problem i am facing, I am sending a
get request the home page of the xxx website, it is
comming fine, after that i am sending a post with user
and password, and that is also comming after that if
send a another get request in the internal site which
requies authorized user, website is checking the
cookie, but the cookie problem, the website is
redirecting the request into home page one agian. 
I try do by removing the SEPARATORS.set(',');  in the
HeaderElement, no use. 
  
Here i placing my sample request program

*

import java.io.IOException;
import java.net.MalformedURLException;
import org.apache.commons.httpclient.Credentials;
import
org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.Cookie;
import
org.apache.commons.httpclient.cookie.CookiePolicy;
import
org.apache.commons.httpclient.methods.GetMethod;
import
org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.Header;


public class Test1
{

 public static void main(String[] args) throws
Exception
{
   
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
   
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
"true");
   
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
"debug");
   
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
  

//create a singular HttpClient object
String HOST =".xxx.com";
int PORT = 80;

HttpClient client = new HttpClient();
client.getHostConfiguration().setHost(HOST,
PORT, "http");
client.getState().setCookiePolicy(
CookiePolicy.COMPATIBILITY );


String url = "/online/on_login1.jsp";
GetMethod getMethod = null;
Header header1 = new Header ("Accept",
"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, */*");
Header header2 = new Header ("Referer",
"http://"; + HOST);
Header header3 = new Header
("Accept-Language", "en-us");
Header header4 = new Header  ("Content-Type",
"application/x-www-form-urlencoded");
Header header5 = new Header
("Accept-Encoding", "gzip, deflate");
Header header6 = new Header
("Proxy-Connection", "Keep-Alive");
Header header7 = new Header ("Pragma",
"no-cache");
Header header8 = new Header ("Cookie",
"name=Online");

getMethod = new GetMethod(url);
getMethod.setFollowRedirects(true);
getMethod.setStrictMode(false);
getMethod.setRequestHeader(header1);
getMethod.setRequestHeader(header2);
getMethod.setRequestHeader(header3);
getMethod.setRequestHeader(header4);
getMethod.setRequestHeader(header5);
getMethod.setRequestHeader(header6);
getMethod.setRequestHeader(header7);
getMethod.setRequestHeader(header8);

//execute the method
String responseBody = null;
try{
client.executeMethod(getMethod);
responseBody =
getMethod.getResponseBodyAsString();
} catch (HttpException he) {
System.err.println("Http error connecting
to '" + url + "'");
System.err.println(he.getMessage());
System.exit(-4);
} catch (IOException ioe){
System.err.println("Unable to connect to
'" + url + "'");
System.exit(-3);
}

Cookie[] logoncookies =
client.getState().getCookies(HOST, PORT, "/", false);
System.out.println("First Request Cookies");
if (logoncookies.length == 0) {
System.out.println("None");
} else {
for (int i = 0; i < logoncookies.length;
i++) {
System.out.println("- " +
logoncookies[i].toString());
}
}

//write out the request headers
System.out.println("*** Request ***");
System.out.println("Request Path: " +
getMethod.getPath());
System.out.println("Request Query: " +
getMethod.getQueryString());
Header[] requestHeaders =
getMethod.getRequestHeaders();
for (int i=0; i wrote: > Hello
Hareesh,
> 
> the cookie shouldn't include commas in the first
> place,
> that's a violation of the respective specification.
> But
> since you have to access that page, try setting a
> different cookie policy. Check out the options in
> org.apache.commons.httpclient.cookie.CookiePolicy
> 
> Try NETSCAPE and BROWSER_COMPATIBILITY.
> 
> cheers,
>   Roland
> 
> 
> 
> 
> 
> 
>

Re: Cookie Problem

2004-02-16 Thread Roland Weber
Hello Hareesh,

the cookie shouldn't include commas in the first place,
that's a violation of the respective specification. But
since you have to access that page, try setting a
different cookie policy. Check out the options in
org.apache.commons.httpclient.cookie.CookiePolicy

Try NETSCAPE and BROWSER_COMPATIBILITY.

cheers,
  Roland







hareesh babu <[EMAIL PROTECTED]>
16.02.2004 12:21
Please respond to "Commons HttpClient Project"
 
To: [EMAIL PROTECTED]
cc: 
Subject:Cookie Problem


Hi, 

I am working on  website using apache commons
library of http client.

I was able to login into the  website using my
code and not able navigate into  website.

I was facing one problem with apache http client at
cookie assumption.

 website is sending cookie like this way,
Set-Cookie:
usr2__com=jzu,aa,czj,dm;path=/;domain=..com;

But apache http client is dividing the cookie into 4.
"Cookie: usr2_xxx_com=jzu[\r][\n]"
"Cookie: aa=[\r][\n]"
"Cookie: czj=[\r][\n]"
"Cookie:
ON_VAT2=103556810351170501155924063287[\r][\n]"
"Cookie: dm=[\r][\n]"

So next when I send a new get method it sending the
 website 4 cookies instead of one.

I am thinking due this problem I was not able to
navigate into  website.

Http client lib i am working on
http://mirrors.xtria.com/apache/jakarta/commons/httpclient/source/commons-httpclient-2.0-rc3-src.zip


Suggest me if am thinking right.

Hareesh.


Yahoo! India Insurance Special: Be informed on the best policies, 
services, tools and more. 
Go to: http://in.insurance.yahoo.com/licspecial/index.html

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]




RE: cookie question - Sorry : Retrying

2004-01-02 Thread Venkat Burri
Hi Jacques
 
Here is code snippet, That might help you
public static void initializeClient(HttpServletRequest request) {

if (httpClient == null)

httpClient = new HttpClient();

httpClient.setConnectionTimeout(3000);

HttpState state = httpClient.getState(); 

state.setCookiePolicy(CookiePolicy.COMPATIBILITY);

Cookie[] cookies = request.getCookies();//This method call gives all the cookies in 
response to the browser request..

}

Thanks
Venkat Burri

-Original Message- 
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Fri 1/2/2004 8:56 AM 
To: Commons HttpClient Project 
Cc: 
Subject: Re: cookie question - Sorry : Retrying



Hi Jacques,

HttpClient automatically processes cookie in the response and adds any
new cookies to the associated HttpState.  Take a look at
HttpClient.getState() and HttpState.getCookies().  There is also some
more info on cookie parsing at
<http://jakarta.apache.org/commons/httpclient/cookies.html>.  You can
also get the raw cookie headers from a response by calling
HttpMethod.getResponseHeader("Set-Cookie") on the executed method.

Mike

On Dec 22, 2003, at 10:27 AM, aruba bulk wrote:

> Hi there (pls ignore my previous post)
>
> I'm using HttpClient to write a Cactus unit test. I'd
> like to simulate a browser, sending a cookie to the
> server with a request. So the cookie originates at the
> client side :
>
> HttpClient client = new HttpClient();
> HttpMethod method = new getMethod(url);
> String cookieValue = "testValue";
> String cookieName = "testname";
> Cookie cookie = new Cookie("localhost", cookieName,
> cookieValue);
> cookie.setPath("/");
>
> HttpState httpState=new HttpState();
> httpState.addCookie(cookie);
> client.setState(httpState);
>
> // Execute the method.
> int statusCode = -1;
> try {
>   statusCode = client.executeMethod(method);
> } catch (HttpRecoverableException e) {}
>   catch (IOException e) {}
>
> // Read the response body.
> byte[] responseBody = method.getResponseBody();
>
> My question is this : I need to check whether the
> server has set any additional cookies in the response.
> How do i do this ?
>
> Any help greatly appreciated.
>
> Regards
> Jacques
>
>
>
> =
> "All one's life is music, if one touches the notes rightly, and in
> time."
> - John Ruskin
>
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: cookie question - Sorry : Retrying

2004-01-02 Thread Michael Becke
Hi Jacques,

HttpClient automatically processes cookie in the response and adds any 
new cookies to the associated HttpState.  Take a look at 
HttpClient.getState() and HttpState.getCookies().  There is also some 
more info on cookie parsing at 
.  You can 
also get the raw cookie headers from a response by calling 
HttpMethod.getResponseHeader("Set-Cookie") on the executed method.

Mike

On Dec 22, 2003, at 10:27 AM, aruba bulk wrote:

Hi there (pls ignore my previous post)

I'm using HttpClient to write a Cactus unit test. I'd
like to simulate a browser, sending a cookie to the
server with a request. So the cookie originates at the
client side :
HttpClient client = new HttpClient();
HttpMethod method = new getMethod(url);
String cookieValue = "testValue";
String cookieName = "testname";
Cookie cookie = new Cookie("localhost", cookieName,
cookieValue);
cookie.setPath("/");
HttpState httpState=new HttpState();
httpState.addCookie(cookie);
client.setState(httpState);
// Execute the method.
int statusCode = -1;
try {
  statusCode = client.executeMethod(method);
} catch (HttpRecoverableException e) {}
  catch (IOException e) {}
// Read the response body.
byte[] responseBody = method.getResponseBody();
My question is this : I need to check whether the
server has set any additional cookies in the response.
How do i do this ?
Any help greatly appreciated.

Regards
Jacques


=
"All one's life is music, if one touches the notes rightly, and in 
time."
- John Ruskin

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie test case failures with Tomcat 4.1.29

2003-11-05 Thread Roland Weber
Hello Eric,

>From RFC 2965, HTTP State Management, Section 3:

   value   = token | quoted-string
[...]
   cookie  =   NAME "=" VALUE *(";" set-cookie-av)
   VALUE   =   value

That is part of the BNF grammar for the set-cookie2 header.
All the examples in section 4 use quoted values, but due to
the token choice, quotes are required only if the value contains
special characters, as defined by RFC 2616 (HTTP 1.1),
section 2.2. As long as there are no special characters in the
value, the test cases should be right.

hope this helps,
  Roland






Eric Johnson <[EMAIL PROTECTED]>
04.11.2003 17:10
Please respond to "Commons HttpClient Project"
 
To: HttpClient <[EMAIL PROTECTED]>
cc: 
Subject:Cookie test case failures with Tomcat 4.1.29


It would seem that the latest Tomcat (4.1.29) has engaged in a subtle 
change in behavior with respect to cookies.  When I ran it this morning, 
nine of the cookie related test cases failed.  Last week, I was running 
with Tomcat 4.1.27, and everything worked fine.

Since I had it readily available, I fell back to Tomcat 4.1.18 (I 
deleted 4.1.27, unfortunately, and Apache is no longer hosting it) and 
ran the tests again, and got all of the tests to pass with no errors.

Upon inspection, the failures would seem to be due to the test servlet 
returning:

simplecookie=value

instead of:

simplecookie="value"

Which is right - our test cases, or the new behavior?

-Eric.


-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]




Re: Cookie test case failures with Tomcat 4.1.29

2003-11-04 Thread Oleg Kalnichevski
Eric,
Damn. I used server-noexamples.xml.config which as it turned out still
uses the deprecated connector. Probably it has not been updated for
quite a while. I'll re-test stuff and get back to you as soon as I know
more. Cookies are still my department.

Cheers

Oleg


On Tue, 2003-11-04 at 22:29, Eric Johnson wrote:
> Oleg,
> 
> I'm glad you sent along the file!  It's funny - other than that one 
> file, I'd say you exactly duplicated the environment I'm using.  That 
> one file is key, though.
> 
> It would appear that your version of server.xml trumps the default 
> "connector" choice.  The default server.xml reads:
> 
> port="8080" minProcessors="5" maxProcessors="75"
>enableLookups="true" redirectPort="8443"
>acceptCount="100" debug="0" connectionTimeout="2"
>useURIValidationHack="false" disableUploadTimeout="true" />
> 
> and yours reads:
> 
> port="8080" minProcessors="5" maxProcessors="75"
>enableLookups="true" redirectPort="8443"
>acceptCount="10" debug="0" connectionTimeout="6"/>
>  
> As far as the docs on the Tomcat site go, this:
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/connectors.html
> indicates that the "HttpConnector" is "deprecated", and the 
> "CoyoteConnector" is the one to use.
> 
> I replaced the "Connector" entry in your server.xml (which worked for 
> me, and generated no test failures, by the way), with the one from the 
> Tomcat original, and reproduced the problem.
> 
> By the way, when I last looked at the older connector, you most 
> definitely didn't want to use it with Tomcat 4.1.18.  It turns out that 
> any GET request that didn't include a "Content-Length" line would be 
> closed by the connector, rather than assuming that the GET request had 
> no content and reuse the connection persistently.  I got really horrible 
> behavior where each request from my web browser meant a new connection 
> to the server.  So much for HTTP  1.1.  The newer CoyoteConnector 
> doesn't show this behavior.
> 
> Of course, this brings us full circle to the original problem - which 
> one is right?
> 
> -Eric.
> 
> Oleg Kalnichevski wrote:
> 
> >Eric,
> >I just installed Tomcat 4.1.29 on my home PC running Redhat 9 and Sun
> >JDK 1.4.2. I can't reproduce the problem. All tests pass. The only thing
> >I did differently was tweaking tomcat's server.xml (attached below) to
> >disable stuff that I do not need. I's unlikely that it should have any
> >bearing on the problem, but who knows.
> >
> >Oleg
> >
> >On Tue, 2003-11-04 at 20:53, Eric Johnson wrote:
> >  
> >
> >>Oleg,
> >>
> >>I hate bugs like this!  I suppose if it is working for you, there's hope 
> >>it can work for me.
> >>
> >>I'm working against a completely stock 4.1.29 install on Linux, using 
> >>Sun's JDK 1.4.2.  When I say "stock" 4.1.29 build, I expanded the file 
> >>after download, dropped httpclienttest folder into webapps, then started 
> >>up Tomcat with a "./catalina.sh run".  Then I ran the tests as reported.
> >>
> >>-Eric.
> >>
> >>Kalnichevski, Oleg wrote:
> >>
> >>
> >>
> >>>Eric,
> >>>Strangely enough, I installed Tomcat 4.1.29 yesterday and had no failing test 
> >>>cases of whatsoever. I reran the test cases with the latest code from CVS HEAD 
> >>>and 2.0 branch against Tomcat 4.1.29 after having read your message. Again, no 
> >>>failing test cases. 
> >>>
> >>>Did you keep your old server.xml file?
> >>>
> >>>Oleg
> >>>
> >>>-Original Message-
> >>>From: Eric Johnson [mailto:[EMAIL PROTECTED]
> >>>Sent: Tuesday, November 04, 2003 17:11
> >>>To: HttpClient
> >>>Subject: Cookie test case failures with Tomcat 4.1.29
> >>>
> >>>
> >>>It would seem that the latest Tomcat (4.1.29) has engaged in a subtle 
> >>>change in behavior with respect to cookies.  When I ran it this morning, 
> >>>nine of the cookie related test cases failed.  Last week, I was running 
> >>>with Tomcat 4.1.27, and everything worked fine.
> >>>
> >>>Since I had it readily available, I fell back to Tomcat 4.1.18 (I 
> >>>deleted 4.1.27, unfortunately, and Apache is no longer hosting it) and 
> >>>ran the tests again, and got all of the tests to pass with no errors.
> >>>
> >>>Upon inspection, the failures would seem to be due to the test servlet 
> >>>returning:
> >>>
> >>>simplecookie=value
> >>>
> >>>instead of:
> >>>
> >>>simplecookie="value"
> >>>
> >>>Which is right - our test cases, or the new behavior?
> >>>
> >>>-Eric.
> >>>
> >>>  
> >>>
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie test case failures with Tomcat 4.1.29

2003-11-04 Thread Eric Johnson
Oleg,

I'm glad you sent along the file!  It's funny - other than that one 
file, I'd say you exactly duplicated the environment I'm using.  That 
one file is key, though.

It would appear that your version of server.xml trumps the default 
"connector" choice.  The default server.xml reads:

   
and yours reads:

   
As far as the docs on the Tomcat site go, this:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/connectors.html
indicates that the "HttpConnector" is "deprecated", and the 
"CoyoteConnector" is the one to use.

I replaced the "Connector" entry in your server.xml (which worked for 
me, and generated no test failures, by the way), with the one from the 
Tomcat original, and reproduced the problem.

By the way, when I last looked at the older connector, you most 
definitely didn't want to use it with Tomcat 4.1.18.  It turns out that 
any GET request that didn't include a "Content-Length" line would be 
closed by the connector, rather than assuming that the GET request had 
no content and reuse the connection persistently.  I got really horrible 
behavior where each request from my web browser meant a new connection 
to the server.  So much for HTTP  1.1.  The newer CoyoteConnector 
doesn't show this behavior.

Of course, this brings us full circle to the original problem - which 
one is right?

-Eric.

Oleg Kalnichevski wrote:

Eric,
I just installed Tomcat 4.1.29 on my home PC running Redhat 9 and Sun
JDK 1.4.2. I can't reproduce the problem. All tests pass. The only thing
I did differently was tweaking tomcat's server.xml (attached below) to
disable stuff that I do not need. I's unlikely that it should have any
bearing on the problem, but who knows.
Oleg

On Tue, 2003-11-04 at 20:53, Eric Johnson wrote:
 

Oleg,

I hate bugs like this!  I suppose if it is working for you, there's hope 
it can work for me.

I'm working against a completely stock 4.1.29 install on Linux, using 
Sun's JDK 1.4.2.  When I say "stock" 4.1.29 build, I expanded the file 
after download, dropped httpclienttest folder into webapps, then started 
up Tomcat with a "./catalina.sh run".  Then I ran the tests as reported.

-Eric.

Kalnichevski, Oleg wrote:

   

Eric,
Strangely enough, I installed Tomcat 4.1.29 yesterday and had no failing test cases of whatsoever. I reran the test cases with the latest code from CVS HEAD and 2.0 branch against Tomcat 4.1.29 after having read your message. Again, no failing test cases. 

Did you keep your old server.xml file?

Oleg

-Original Message-
From: Eric Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 17:11
To: HttpClient
Subject: Cookie test case failures with Tomcat 4.1.29
It would seem that the latest Tomcat (4.1.29) has engaged in a subtle 
change in behavior with respect to cookies.  When I ran it this morning, 
nine of the cookie related test cases failed.  Last week, I was running 
with Tomcat 4.1.27, and everything worked fine.

Since I had it readily available, I fell back to Tomcat 4.1.18 (I 
deleted 4.1.27, unfortunately, and Apache is no longer hosting it) and 
ran the tests again, and got all of the tests to pass with no errors.

Upon inspection, the failures would seem to be due to the test servlet 
returning:

simplecookie=value

instead of:

simplecookie="value"

Which is right - our test cases, or the new behavior?

-Eric.

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie test case failures with Tomcat 4.1.29

2003-11-04 Thread Oleg Kalnichevski
Eric,
I just installed Tomcat 4.1.29 on my home PC running Redhat 9 and Sun
JDK 1.4.2. I can't reproduce the problem. All tests pass. The only thing
I did differently was tweaking tomcat's server.xml (attached below) to
disable stuff that I do not need. I's unlikely that it should have any
bearing on the problem, but who knows.

Oleg

On Tue, 2003-11-04 at 20:53, Eric Johnson wrote:
> Oleg,
> 
> I hate bugs like this!  I suppose if it is working for you, there's hope 
> it can work for me.
> 
> I'm working against a completely stock 4.1.29 install on Linux, using 
> Sun's JDK 1.4.2.  When I say "stock" 4.1.29 build, I expanded the file 
> after download, dropped httpclienttest folder into webapps, then started 
> up Tomcat with a "./catalina.sh run".  Then I ran the tests as reported.
> 
> -Eric.
> 
> Kalnichevski, Oleg wrote:
> 
> >Eric,
> >Strangely enough, I installed Tomcat 4.1.29 yesterday and had no failing test cases 
> >of whatsoever. I reran the test cases with the latest code from CVS HEAD and 2.0 
> >branch against Tomcat 4.1.29 after having read your message. Again, no failing test 
> >cases. 
> >
> >Did you keep your old server.xml file?
> >
> >Oleg
> >
> >-Original Message-
> >From: Eric Johnson [mailto:[EMAIL PROTECTED]
> >Sent: Tuesday, November 04, 2003 17:11
> >To: HttpClient
> >Subject: Cookie test case failures with Tomcat 4.1.29
> >
> >
> >It would seem that the latest Tomcat (4.1.29) has engaged in a subtle 
> >change in behavior with respect to cookies.  When I ran it this morning, 
> >nine of the cookie related test cases failed.  Last week, I was running 
> >with Tomcat 4.1.27, and everything worked fine.
> >
> >Since I had it readily available, I fell back to Tomcat 4.1.18 (I 
> >deleted 4.1.27, unfortunately, and Apache is no longer hosting it) and 
> >ran the tests again, and got all of the tests to pass with no errors.
> >
> >Upon inspection, the failures would seem to be due to the test servlet 
> >returning:
> >
> >simplecookie=value
> >
> >instead of:
> >
> >simplecookie="value"
> >
> >Which is right - our test cases, or the new behavior?
> >
> >-Eric.
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


  








  

  
  

  

  



  



  




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Cookie test case failures with Tomcat 4.1.29

2003-11-04 Thread Eric Johnson
Oleg,

I hate bugs like this!  I suppose if it is working for you, there's hope 
it can work for me.

I'm working against a completely stock 4.1.29 install on Linux, using 
Sun's JDK 1.4.2.  When I say "stock" 4.1.29 build, I expanded the file 
after download, dropped httpclienttest folder into webapps, then started 
up Tomcat with a "./catalina.sh run".  Then I ran the tests as reported.

-Eric.

Kalnichevski, Oleg wrote:

Eric,
Strangely enough, I installed Tomcat 4.1.29 yesterday and had no failing test cases of whatsoever. I reran the test cases with the latest code from CVS HEAD and 2.0 branch against Tomcat 4.1.29 after having read your message. Again, no failing test cases. 

Did you keep your old server.xml file?

Oleg

-Original Message-
From: Eric Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 17:11
To: HttpClient
Subject: Cookie test case failures with Tomcat 4.1.29
It would seem that the latest Tomcat (4.1.29) has engaged in a subtle 
change in behavior with respect to cookies.  When I ran it this morning, 
nine of the cookie related test cases failed.  Last week, I was running 
with Tomcat 4.1.27, and everything worked fine.

Since I had it readily available, I fell back to Tomcat 4.1.18 (I 
deleted 4.1.27, unfortunately, and Apache is no longer hosting it) and 
ran the tests again, and got all of the tests to pass with no errors.

Upon inspection, the failures would seem to be due to the test servlet 
returning:

simplecookie=value

instead of:

simplecookie="value"

Which is right - our test cases, or the new behavior?

-Eric.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Cookie test case failures with Tomcat 4.1.29

2003-11-04 Thread Kalnichevski, Oleg
Eric,
Strangely enough, I installed Tomcat 4.1.29 yesterday and had no failing test cases of 
whatsoever. I reran the test cases with the latest code from CVS HEAD and 2.0 branch 
against Tomcat 4.1.29 after having read your message. Again, no failing test cases. 

Did you keep your old server.xml file?

Oleg

-Original Message-
From: Eric Johnson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 17:11
To: HttpClient
Subject: Cookie test case failures with Tomcat 4.1.29


It would seem that the latest Tomcat (4.1.29) has engaged in a subtle 
change in behavior with respect to cookies.  When I ran it this morning, 
nine of the cookie related test cases failed.  Last week, I was running 
with Tomcat 4.1.27, and everything worked fine.

Since I had it readily available, I fell back to Tomcat 4.1.18 (I 
deleted 4.1.27, unfortunately, and Apache is no longer hosting it) and 
ran the tests again, and got all of the tests to pass with no errors.

Upon inspection, the failures would seem to be due to the test servlet 
returning:

simplecookie=value

instead of:

simplecookie="value"

Which is right - our test cases, or the new behavior?

-Eric.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Troubles

2003-10-17 Thread Oliver Köll
Hi Oleg,

i applied your (second) patch regarding the Exceptions thrown by bad 
Cookies. I haven't been able to really test it, because today the 
website doesn't seem to send those Cookies anymore that have been 
troubling me yesterday. But from looking at the code, the patch should 
address my problem.

The website's Cookies still are not parsed, because they also send 
invalid date strings, but i cannot expect HttpClient to parse every 
junk it encounters. I'm happy now, that reponse handling is not aborted 
because of bad Cookies.

Looking forward to pluggable Cookie parsing in HttpClient 2.1.

Cheers, Oliver

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie Troubles

2003-10-16 Thread Oliver Köll
Hi Oleg,

thanks for the fast turnaround - but, which patch do you mean?

Cheers, Oliver

On Donnerstag, Okt 16, 2003, at 12:12 Europe/Berlin, Kalnichevski, Oleg 
wrote:

Hi Olver,

See my comments in-line

I'm dealing with a site that serves invalid Cookies in various kind of
ways. In some cases the Cookie values contain "," characters, which
really confuses the Header/Cookie parsers and eventually leads to
IllegalArgumentExceptions thrown by the Cookie constructor:
This is not that easy. Commas in cookie headers are enormously hard to 
deal with because it can never tell if

param=stuff,more_stuff

is meant to be

param="stuff,more_stuff"

or

param=stuff, more_stuff=null

Anyways, I'll tweak the CookieSpecBase to avoid attempts to create an 
instance of Cookie class if cookie name is invalid.


What bothers me, is that these IllegalArgumentExceptions are never
caught in the HttpClient code, making it effectivily impossible to
handle these responses.
Fair enough. I'll review the cookie parser and make sure that it 
throws MalformedCookieException exception if it comes across an 
invalid cookie header

3) Finally, wouldn't it be nice to have the possibility to plug-in 
your
own custom Cookie parser, allowing more control with 
parsing/validating
bad Cookies? Something like
This is a well known limitation whose resolution is targeted for 2.1 
release

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21151

Cheers

Oleg

-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[PATCH] RE: Cookie Troubles

2003-10-16 Thread Kalnichevski, Oleg
This patch should take care of the problem with invalid cookies causing runtime 
exceptions

Please let me know what you think

Oleg

-Original Message-
From: Oliver Köll [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 11:35
To: [EMAIL PROTECTED]
Subject: Cookie Troubles


This is my first appearance here - so, hi to all and thanks to the  
Apache guys for all the nice work!

Now to my problems (using version 2.0 rc2):

I'm dealing with a site that serves invalid Cookies in various kind of  
ways. In some cases the Cookie values contain "," characters, which  
really confuses the Header/Cookie parsers and eventually leads to  
IllegalArgumentExceptions thrown by the Cookie constructor:

java.lang.IllegalArgumentException: Cookie name may not be blank
   at org.apache.commons.httpclient.Cookie.(Cookie.java:142)
   at  
org.apache.commons.httpclient.cookie.CookieSpecBase.parse(CookieSpecBase 
.java:192)
   at  
org.apache.commons.httpclient.cookie.CookieSpecBase.parse(CookieSpecBase 
.java:256)
   at  
org.apache.commons.httpclient.HttpMethodBase.processResponseHeaders(Http 
MethodBase.java:1826)
   at  
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase 
.java:1939)
   at  
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBa 
se.java:2631)
   at  
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java 
:1085)
   at  
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:6 
74)
   at  
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:5 
29)
   at my.code.Test.getHttp(Test.java:114)

What bothers me, is that these IllegalArgumentExceptions are never  
caught in the HttpClient code, making it effectivily impossible to  
handle these responses.

My questions/suggestions:

1) There are lots of IllegalArgumentExceptions thrown in CookieSpecBase  
and Cookie. These should be either caught, or replaced with (or  
converted to) MalformedCookieExceptions, which are handled in  
HttpMethodBase.

2) Wouldn't it make sense to create an additional  
CookiePolicy.IGNORE_COOKIES that disables cookie parsing? This would be  
useful, if you either do not care about Cookies or if they are so  
messed up, that there is no hope parsing them.

3) Finally, wouldn't it be nice to have the possibility to plug-in your  
own custom Cookie parser, allowing more control with parsing/validating  
bad Cookies? Something like

   HttpState.setCookiePolicy( CookiePolicy.CUSTOM, myCustomCookieSpec)

shouldn't be too difficult to implement.

Cheers,

Oliver


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Cookie Troubles

2003-10-16 Thread Kalnichevski, Oleg
Hi Olver,

See my comments in-line

> I'm dealing with a site that serves invalid Cookies in various kind of  
> ways. In some cases the Cookie values contain "," characters, which  
> really confuses the Header/Cookie parsers and eventually leads to  
> IllegalArgumentExceptions thrown by the Cookie constructor:

This is not that easy. Commas in cookie headers are enormously hard to deal with 
because it can never tell if 

param=stuff,more_stuff

is meant to be 

param="stuff,more_stuff" 

or 

param=stuff, more_stuff=null

Anyways, I'll tweak the CookieSpecBase to avoid attempts to create an instance of 
Cookie class if cookie name is invalid.


> What bothers me, is that these IllegalArgumentExceptions are never  
> caught in the HttpClient code, making it effectivily impossible to  
> handle these responses.

Fair enough. I'll review the cookie parser and make sure that it throws 
MalformedCookieException exception if it comes across an invalid cookie header

> 3) Finally, wouldn't it be nice to have the possibility to plug-in your  
> own custom Cookie parser, allowing more control with parsing/validating  
> bad Cookies? Something like

This is a well known limitation whose resolution is targeted for 2.1 release

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21151

Cheers

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Troubles

2003-10-16 Thread SrinivasaGandhi Sampath
I've been breaking my head with this same issue the past couple of days.
Looks like even some of the most popular servers send back invalid
cookies - some do this intermittently that makes preparing for a demo a
nightmare :-(

I also think the addition of CookiePolicy.IGNORE_COOKIES will be useful.
Still better could be to have a CookiePolicy.IGNORE_INVALID_COOKIES
setting that will just ignore the invalid cookies and return the valid
ones.

-Gandhi


> -Original Message-
> From: Oliver Köll [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 16, 2003 3:05 PM
> To: [EMAIL PROTECTED]
> Subject: Cookie Troubles
> 
> 
> This is my first appearance here - so, hi to all and thanks to the  
> Apache guys for all the nice work!
> 
> Now to my problems (using version 2.0 rc2):
> 
> I'm dealing with a site that serves invalid Cookies in 
> various kind of  
> ways. In some cases the Cookie values contain "," characters, which  
> really confuses the Header/Cookie parsers and eventually leads to  
> IllegalArgumentExceptions thrown by the Cookie constructor:
> 
> java.lang.IllegalArgumentException: Cookie name may not be blank
>at org.apache.commons.httpclient.Cookie.(Cookie.java:142)
>at  
> org.apache.commons.httpclient.cookie.CookieSpecBase.parse(Cook
> ieSpecBase 
> .java:192)
>at  
> org.apache.commons.httpclient.cookie.CookieSpecBase.parse(Cook
> ieSpecBase 
> .java:256)
>at  
> org.apache.commons.httpclient.HttpMethodBase.processResponseHe
> aders(Http 
> MethodBase.java:1826)
>at  
> org.apache.commons.httpclient.HttpMethodBase.readResponse(Http
> MethodBase 
> .java:1939)
>at  
> org.apache.commons.httpclient.HttpMethodBase.processRequest(Ht
> tpMethodBa 
> se.java:2631)
>at  
> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMetho
> dBase.java 
> :1085)
>at  
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpCli
> ent.java:6 
> 74)
>at  
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpCli
> ent.java:5 
> 29)
>at my.code.Test.getHttp(Test.java:114)
> 
> What bothers me, is that these IllegalArgumentExceptions are never  
> caught in the HttpClient code, making it effectivily impossible to  
> handle these responses.
> 
> My questions/suggestions:
> 
> 1) There are lots of IllegalArgumentExceptions thrown in 
> CookieSpecBase  
> and Cookie. These should be either caught, or replaced with (or  
> converted to) MalformedCookieExceptions, which are handled in  
> HttpMethodBase.
> 
> 2) Wouldn't it make sense to create an additional  
> CookiePolicy.IGNORE_COOKIES that disables cookie parsing? 
> This would be  
> useful, if you either do not care about Cookies or if they are so  
> messed up, that there is no hope parsing them.
> 
> 3) Finally, wouldn't it be nice to have the possibility to 
> plug-in your  
> own custom Cookie parser, allowing more control with 
> parsing/validating  
> bad Cookies? Something like
> 
>HttpState.setCookiePolicy( CookiePolicy.CUSTOM, myCustomCookieSpec)
> 
> shouldn't be too difficult to implement.
> 
> Cheers,
> 
> Oliver
> 
> 
> -
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Out of luck... was RE: Posting Issues was RE: Cookie Issues

2003-07-01 Thread ross_r
I think I may just had too much cruff in my code with all the different
version of the Client I have been using.  I just started that class over and
bang it works.  Thanks for all the help!  No headers, no cookies...

Ross

-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 01, 2003 5:09 PM
To: Commons HttpClient Project
Subject: Re: Out of luck... was RE: Posting Issues was RE: Cookie Issues

Ross,

curiously enough, it seems to work for me. Have a look at my code.
Please I note that I do not even set the cookies

import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;

public class Test {

 public static void main(String args[]) throws Exception {

   HttpClient httpclient = new HttpClient();
   httpclient.getHostConfiguration().
 setHost("www.careerbuilder.com");

   PostMethod httppost = new  
 PostMethod("/JobSeeker/Jobs/JobQuery.asp?ch=al");
   httppost.setRequestBody(new NameValuePair[] {
new NameValuePair("st", "a"),
new NameValuePair("Words", "java"),
new NameValuePair("Use", "All"),
new NameValuePair("Town", "New York"),
new NameValuePair("states", "NY, US"),
new NameValuePair("Freshness", ""),
new NameValuePair("EdLevel", "DR3"),
new NameValuePair("EdExec", "YES"),
new NameValuePair("EmpType", "JTFT"),
new NameValuePair("EmpType", "JTCT"),
new NameValuePair("EmpType", "JTIN"),
new NameValuePair("minsalary", "0"),
new NameValuePair("maxsalary", "gt120"),
new NameValuePair("vt", "title"),
new NameValuePair("submit1", "Search"),
new NameValuePair("sname", ""),
new NameValuePair("jrdid", "")
   });
   httpclient.executeMethod(httppost);
   System.out.println(httppost.getStatusLine().toString()); 
 }
}

Here's the wire log:
[DEBUG] HttpConnection - -Creating connection for www.careerbuilder.com
using protocol http:80
[DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0)
[DEBUG] HttpMethodBase - -Execute loop try 1
[DEBUG] wire - ->> "POST /JobSeeker/Jobs/JobQuery.asp?ch=al
HTTP/1.1[\r][\n]"
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] HttpMethodBase - -Default charset used: ISO-8859-1
[DEBUG] wire - ->> "User-Agent: Jakarta
Commons-HttpClient/2.0beta1[\r][\n]"
[DEBUG] wire - ->> "Host: www.careerbuilder.com[\r][\n]"
[DEBUG] wire - ->> "Content-Length: 192[\r][\n]"
[DEBUG] wire - ->> "Content-Type:
application/x-www-form-urlencoded[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] EntityEnclosingMethod - -Using buffered request body
[DEBUG] wire - ->>
"st=a&Words=java&Use=All&Town=New+York&states=NY%2C+US&Freshness=&EdLevel=DR
3&EdExec=YES&EmpType=JTFT&EmpType=JTCT&EmpType=JTIN&minsalary=0&maxsalary=gt
120&vt=title&submit1=Search&sname=&jrdid="
[DEBUG] EntityEnclosingMethod - -Request body sent
[DEBUG] wire - -<< "HTTP/1.1 100 Continue[\r][\n]"
[DEBUG] wire - -<< "Server: Microsoft-IIS/5.0[\r][\n]"
[DEBUG] wire - -<< "Date: Tue, 01 Jul 2003 21:06:11 GMT[\r][\n]"
[DEBUG] wire - -<< "X-Powered-By: ASP.NET[\r][\n]"
[DEBUG] wire - -<< "Set-Cookie:
BID=X18C559B8C350AE80576C24166B2448E1D10808848058E0F6BA508EB171ED18E8F;
domain=.careerbuilder.com; expires=Wed, 30-Jun-2004 15:00:00 GMT;
path=/[\r][\n]"
[DEBUG] HttpMethodBase - -Cookie accepted: "$Version=0;
BID=X18C559B8C350AE80576C24166B2448E1D10808848058E0F6BA508EB171ED18E8F;
$Domain=.careerbuilder.com; $Path=/"
[INFO] HttpMethodBase - -Discarding unexpected response: HTTP/1.1 100
Continue
[DEBUG] wire - -<< "HTTP/1.1 302 Found[\r][\n]"
[DEBUG] wire - -<< "Server: Microsoft-IIS/5.0[\r][\n]"
[DEBUG] wire - -<< "Date: Tue, 01 Jul 2003 21:06:11 GMT[\r][\n]"
[DEBUG] wire - -<< "X-Powered-By: ASP.NET[\r][\n]"
[DEBUG] wire - -<< "Connection: close[\r][\n]"
[DEBUG] wire - -<< "Set-Cookie:
BID=X18C559B8C350AE80576C24166B2448E1D10808848058E0F6BA508EB171ED18E8F;
domain=.careerbuilder.com; expires=Wed, 30-Jun-2004 15:00:00 GMT;
path=/[\r][\n]"
[DEBUG] wire - -<< "Location:
http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al&st=a&jrdid=&s
tates=NY%2C+US&Freshness=&vt=title&Town=New+Yor

Re: Out of luck... was RE: Posting Issues was RE: Cookie Issues

2003-07-01 Thread Oleg Kalnichevski
dr.com/images/CBP3P.xml"[\r][\n]";
[DEBUG] wire - -<< "Content-Length: 0[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
[DEBUG] wire - -<< "Set-Cookie:
CB%5FSID=c015e8d44ea5471982040cc793b46089%2D110394372%2Dwr%2D2;
domain=.careerbuilder.com; path=/[\r][\n]"
[DEBUG] wire - -<< "Set-Cookie: bJobSeeker=True; expires=Thu,
01-Jul-2004 21:06:12 GMT; domain=.careerbuilder.com; path=/[\r][\n]"
[DEBUG] wire - -<< "Cache-control: private[\r][\n]"
[DEBUG] HttpMethodBase - -Cookie accepted: "$Version=0;
BID=X18C559B8C350AE80576C24166B2448E1D10808848058E0F6BA508EB171ED18E8F;
$Domain=.careerbuilder.com; $Path=/"
[DEBUG] HttpMethodBase - -Cookie accepted: "$Version=0;
CB%5FSID=c015e8d44ea5471982040cc793b46089%2D110394372%2Dwr%2D2;
$Domain=.careerbuilder.com; $Path=/"
[DEBUG] HttpMethodBase - -Cookie accepted: "$Version=0; bJobSeeker=True;
$Domain=.careerbuilder.com; $Path=/"
[DEBUG] HttpMethodBase - -Redirect required
[INFO] HttpMethodBase - -Redirect requested but followRedirects is
disabled


HTTP/1.1 302 Found

Am I missing something?

Oleg



On Tue, 2003-07-01 at 21:51, [EMAIL PROTECTED] wrote:
> Welp, I have tried everything I can think of cookie types, http 1.0 versus
> 1.1, even matching the headers line for line.  It is even the exact same
> content-length as the browser trace.  I still get the 200 OK instead of the
> 302 Found with the new location I need.  I'm at a loss.  
> 
> Here's my latest trace for any eagle eye that can help.  I don't even know
> what else to try.  Any suggestions?
> 
> Ross
> 
> 
> 
> -Original Message-
> From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 01, 2003 2:18 PM
> To: Commons HttpClient Project
> Subject: Re: Posting Issues was RE: Cookie Issues
> 
> Ross,
> I'd say giving empty string "" or a blank " " as a parameter _should_
> work around the problem. Still, it does seem to be a bug in HttpClient,
> and a proper fix must be implemented. I'll get back to you as soon as I
> know more.
> 
> Oleg
> 
> 
> On Tue, 2003-07-01 at 20:11, Ross Rankin wrote:
> > I think I might have an idea but I don't know how to solve it...
> > Here ths Posted information from the HTTPClient:
> > 
> > st=a
> > Words=java
> > Use=All
> > Town=New+York
> > states=NY%2C+US
> > Freshness=
> > EdLevel=DR3
> > EdExec=YES
> > EmpType=JTFT
> > EmpType=JTCT
> > EmpType=JTIN
> > minsalary=0
> > maxsalary=gt120
> > vt=title
> > submit1=Search
> > sname=
> > jrdid
> > 
> > Versus the post info from the browser:
> > st=a
> > Words=java
> > Use=All
> > Town=new+york
> > states=NY%2C+US
> > Freshness=
> > EdLevel=DR3
> > EdExc=YES
> > EmpType=JTFT
> > EmpType=JTCT
> > EmpType=JTIN
> > minsalary=0
> > maxsalary=gt120
> > vt=title
> > submit1=Search
> > sname=
> > jrdid=
> > 
> > Well they look identical, but I noticed the missing '=' on the jrdid
> > parameter.  So I did an experiment, I created a form and did a post by
> > typing the URL instead of letting the form post.  Well, to the posted page
> > jrdid vs. jrdid= is the difference between null and empty string.
> > 
> > So, in my code, I have an array of name value pairs which I do setName and
> > setValue on, how do I in the last item make it append the = sign rather
> than
> > dropping it?  
> > 
> > Thanks.
> > 
> > Ross
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, June 30, 2003 1:38 PM
> > To: 'Commons HttpClient Project'
> > Subject: RE: Cookie Issues
> > 
> > Well it has changed my problem.  Here what happens now, I still do not get
> > the post results that I want.  Here's the proxy trace with a browser:
> > 
> > POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
> > Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> > application/vnd.ms-excel, application/vnd.ms-powerpoint,
> > application/msword, */*
> > Referer:
> > http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
> > Accept-Language: en-us
> > Content-Type: application/x-www-form-urlencoded
> > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
> > 5.0.0.0; .NET CLR 1.0.3705; .N

RE: Out of luck... was RE: Posting Issues was RE: Cookie Issues

2003-07-01 Thread Wilcox, Mark
Did you check to see if perhaps you're sending "\n" and the browser is sending "\r\n"?
 
A blind stab in the dark :).
Mark

-Original Message- 
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tue 7/1/2003 3:51 PM 
To: 'Commons HttpClient Project' 
Cc: 
Subject: Out of luck... was RE: Posting Issues was RE: Cookie Issues



Welp, I have tried everything I can think of cookie types, http 1.0 versus
1.1, even matching the headers line for line.  It is even the exact same
content-length as the browser trace.  I still get the 200 OK instead of the
302 Found with the new location I need.  I'm at a loss. 

Here's my latest trace for any eagle eye that can help.  I don't even know
what else to try.  Any suggestions?

Ross



-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 01, 2003 2:18 PM
To: Commons HttpClient Project
Subject: Re: Posting Issues was RE: Cookie Issues

Ross,
I'd say giving empty string "" or a blank " " as a parameter _should_
work around the problem. Still, it does seem to be a bug in HttpClient,
and a proper fix must be implemented. I'll get back to you as soon as I
know more.

Oleg


On Tue, 2003-07-01 at 20:11, Ross Rankin wrote:
> I think I might have an idea but I don't know how to solve it...
> Here ths Posted information from the HTTPClient:
>
>   st=a
>   Words=java
>   Use=All
>   Town=New+York
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExec=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid
>
> Versus the post info from the browser:
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
>
> Well they look identical, but I noticed the missing '=' on the jrdid
> parameter.  So I did an experiment, I created a form and did a post by
> typing the URL instead of letting the form post.  Well, to the posted page
> jrdid vs. jrdid= is the difference between null and empty string.
>
> So, in my code, I have an array of name value pairs which I do setName and
> setValue on, how do I in the last item make it append the = sign rather
than
> dropping it? 
>
> Thanks.
    >
> Ross
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 30, 2003 1:38 PM
> To: 'Commons HttpClient Project'
> Subject: RE: Cookie Issues
>
> Well it has changed my problem.  Here what happens now, I still do not get
> the post results that I want.  Here's the proxy trace with a browser:
>
>   POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
>   Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/vnd.ms-excel, application/vnd.ms-powerpoint,
> application/msword, */*
>   Referer:
> http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
>   Accept-Language: en-us
>   Content-Type: application/x-www-form-urlencoded
>   User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
> 5.0.0.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
>   Host: www.careerbuilder.com
>   Content-Length: 191
>   Pragma: no-cache
>   Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A1314C4A2FA0C33F3DC0A204C3B55F8553AF
;
> bJobSeeker=True;
> CB%5FSID=e81477595a9e4a5b9d9e386d618e0b15%2D110294498%2Drh%2D1; PU=0
>   Connection: keep-alive
>   A

Re: Posting Issues was RE: Cookie Issues

2003-07-01 Thread Oleg Kalnichevski
Ross,
I just checked the code. It looks like the bug has been fixed just
recently (that is, after beta-1 release). So, you might want to try
running your application with the current CVS snapshot or wait a short
while until beta-2.

I would also try faking the 'User-Agent' header as suggested by Mike

Cheers

Oleg

On Tue, 2003-07-01 at 20:11, Ross Rankin wrote:
> I think I might have an idea but I don't know how to solve it...



> Here ths Posted information from the HTTPClient:
> 
>   st=a
>   Words=java
>   Use=All
>   Town=New+York
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExec=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid
> 
> Versus the post info from the browser:
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
> 
> Well they look identical, but I noticed the missing '=' on the jrdid
> parameter.  So I did an experiment, I created a form and did a post by
> typing the URL instead of letting the form post.  Well, to the posted page
> jrdid vs. jrdid= is the difference between null and empty string.
> 
> So, in my code, I have an array of name value pairs which I do setName and
> setValue on, how do I in the last item make it append the = sign rather than
> dropping it?  
> 
> Thanks.
> 
> Ross
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 30, 2003 1:38 PM
> To: 'Commons HttpClient Project'
> Subject: RE: Cookie Issues
> 
> Well it has changed my problem.  Here what happens now, I still do not get
> the post results that I want.  Here's the proxy trace with a browser:
> 
>   POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
>   Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/vnd.ms-excel, application/vnd.ms-powerpoint,
> application/msword, */*
>   Referer:
> http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
>   Accept-Language: en-us
>   Content-Type: application/x-www-form-urlencoded
>   User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
> 5.0.0.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
>   Host: www.careerbuilder.com
>   Content-Length: 191
>   Pragma: no-cache
>   Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A1314C4A2FA0C33F3DC0A204C3B55F8553AF;
> bJobSeeker=True;
> CB%5FSID=e81477595a9e4a5b9d9e386d618e0b15%2D110294498%2Drh%2D1; PU=0
>   Connection: keep-alive
>   Accept-encoding: gzip, deflate
>   Browser reload detected...
>   Posting 191 bytes...
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
>   Continue ignored...
> 
>   +++RESP 12+++
>   HTTP/1.1 302 Found
>   Server: Microsoft-IIS/5.0
>   Date: Mon, 30 Jun 2003 17:23:37 GMT
>   X-Powered-By: ASP.NET
>   Connection: close
>   Set-Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A131AE9ACC050B2FDB88D31C12A6193198AB;
> domain=.careerbuilder.com; expires=Tue, 29-Jun-2004 15:00:00 GMT;
> path=/
>   Location:
> /JobSeeker/Jobs/JobResults.asp?jrdid=&strCrit=QID%3DA3846750832018%3Bs
> t%3Da%3Buse%3DAll%3BrawWords%3Djava%3BTID%3D13938%3BBID%3DD2J8%3BCTY%3
> DNew+York%3BSID%3DNY%3BCID%3DUS%3BENR%3DNO%3BDTP%3DDR3%3BYDI%3DYES%3BI
> ND%3DAll%3BPDQ%3DAll%3BJN%3DAll%3BPAYL%3D0%3BPAYH%3Dgt120%3BPOY%3DNO%3
> BETD%3DJTFT%3BETD%3DJTCT%3BETD%3DJTIN%3BRE%3DALL%3BMGT%3DDC%3BSUP%3DDC
> %3BFRE%3D30%3BCHL%3Dal%3BQS%3Dhhr%5FJobQuery%2Easp%3BSS%3DNO%3BTITL%3D
> 0%3BVT%3Dtitle&CiBookMark=1&sname=
>   Connection: close
>   P3P: CP="CAO CURa IVAa HISa OUR IND UNI COM NAV INT
> STA",policyref="http://img.icbdr.com/images/CBP3P.xml";
>   Content-Length: 0
>   Content-Type: text/html; charset=ISO-8859-1
>   Set-Cookie: bJobSeeker=True; expires=Wed, 30-Jun-2004 17:23:36 GMT;
> domain=.careerbuilder.com; path=/
>   
> Note the 302 result with the page lo

Re: Out of luck... was RE: Posting Issues was RE: Cookie Issues

2003-07-01 Thread Michael Becke
My only other thought is to set the user agent.  You can do this with:

	HttpMethod.setRequestHeader("User-Agent", "Mozilla, etc");

You should make this value the same as what your browser is using.

Mike

[EMAIL PROTECTED] wrote:
Welp, I have tried everything I can think of cookie types, http 1.0 versus
1.1, even matching the headers line for line.  It is even the exact same
content-length as the browser trace.  I still get the 200 OK instead of the
302 Found with the new location I need.  I'm at a loss.  

Here's my latest trace for any eagle eye that can help.  I don't even know
what else to try.  Any suggestions?
Ross



-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 01, 2003 2:18 PM
To: Commons HttpClient Project
Subject: Re: Posting Issues was RE: Cookie Issues

Ross,
I'd say giving empty string "" or a blank " " as a parameter _should_
work around the problem. Still, it does seem to be a bug in HttpClient,
and a proper fix must be implemented. I'll get back to you as soon as I
know more.
Oleg

On Tue, 2003-07-01 at 20:11, Ross Rankin wrote:

I think I might have an idea but I don't know how to solve it...
Here ths Posted information from the HTTPClient:
st=a
Words=java
Use=All
Town=New+York
states=NY%2C+US
Freshness=
EdLevel=DR3
EdExec=YES
EmpType=JTFT
EmpType=JTCT
EmpType=JTIN
minsalary=0
maxsalary=gt120
vt=title
submit1=Search
sname=
jrdid
Versus the post info from the browser:
st=a
Words=java
Use=All
Town=new+york
states=NY%2C+US
Freshness=
EdLevel=DR3
EdExc=YES
EmpType=JTFT
EmpType=JTCT
EmpType=JTIN
minsalary=0
maxsalary=gt120
vt=title
submit1=Search
sname=
jrdid=
Well they look identical, but I noticed the missing '=' on the jrdid
parameter.  So I did an experiment, I created a form and did a post by
typing the URL instead of letting the form post.  Well, to the posted page
jrdid vs. jrdid= is the difference between null and empty string.
So, in my code, I have an array of name value pairs which I do setName and
setValue on, how do I in the last item make it append the = sign rather
than

dropping it?  

Thanks.

Ross

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 30, 2003 1:38 PM
To: 'Commons HttpClient Project'
Subject: RE: Cookie Issues

Well it has changed my problem.  Here what happens now, I still do not get
the post results that I want.  Here's the proxy trace with a browser:
POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, */*
Referer:
http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
5.0.0.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Host: www.careerbuilder.com
Content-Length: 191
Pragma: no-cache
Cookie:
BID=X1AF7F150CF82DEEBA4E03DAF0F931A1314C4A2FA0C33F3DC0A204C3B55F8553AF
;

bJobSeeker=True;
CB%5FSID=e81477595a9e4a5b9d9e386d618e0b15%2D110294498%2Drh%2D1; PU=0
Connection: keep-alive
Accept-encoding: gzip, deflate
Browser reload detected...
Posting 191 bytes...
st=a
Words=java
Use=All
Town=new+york
states=NY%2C+US
Freshness=
EdLevel=DR3
EdExc=YES
EmpType=JTFT
EmpType=JTCT
EmpType=JTIN
minsalary=0
maxsalary=gt120
vt=title
submit1=Search
sname=
jrdid=
Continue ignored...
+++RESP 12+++
HTTP/1.1 302 Found
Server: Microsoft-IIS/5.0
Date: Mon, 30 Jun 2003 17:23:37 GMT
X-Powered-By: ASP.NET
Connection: close
Set-Cookie:
BID=X1AF7F150CF82DEEBA4E03DAF0F931A131AE9ACC050B2FDB88D31C12A6193198AB
;

domain=.careerbuilder.com; expires=Tue, 29-Jun-2004 15:00:00 GMT;
path=/
Location:
/JobSeeker/Jobs/JobResults.asp?jrdid=&strCrit=QID%3DA3846750832018%3Bs
t%3Da%3Buse%3DAll%3BrawWords%3Djava%3BTID%3D13938%3BBID%3DD2J8%3BCTY%3
DNew+York%3BSID%3DNY%3BCID%3DUS%3BENR%3DNO%3BDTP%3DDR3%3BYDI%3DYES%3BI
ND%3DAll%3BPDQ%3DAll%3BJN%3DAll%3BPAYL%3D0%3BPAYH%3Dgt120%3BPOY%3DNO%3
BETD%3DJTFT%3BETD%3DJTCT%3BETD%3DJTIN%3BRE%3DALL%3BMGT%3DDC%3BSUP%3DDC
%3BFRE%3D30%3BCHL%3Dal%3BQS%3Dhhr%5FJobQuery%2Easp%3BSS%3DNO%3BTITL%3D
0%3BVT%3Dtitle&CiBookMark=1&sname=
Connection: close
P3P: CP="CAO CURa IVAa HISa OUR IND UNI COM NAV INT
S

Out of luck... was RE: Posting Issues was RE: Cookie Issues

2003-07-01 Thread ross_r
Welp, I have tried everything I can think of cookie types, http 1.0 versus
1.1, even matching the headers line for line.  It is even the exact same
content-length as the browser trace.  I still get the 200 OK instead of the
302 Found with the new location I need.  I'm at a loss.  

Here's my latest trace for any eagle eye that can help.  I don't even know
what else to try.  Any suggestions?

Ross



-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 01, 2003 2:18 PM
To: Commons HttpClient Project
Subject: Re: Posting Issues was RE: Cookie Issues

Ross,
I'd say giving empty string "" or a blank " " as a parameter _should_
work around the problem. Still, it does seem to be a bug in HttpClient,
and a proper fix must be implemented. I'll get back to you as soon as I
know more.

Oleg


On Tue, 2003-07-01 at 20:11, Ross Rankin wrote:
> I think I might have an idea but I don't know how to solve it...
> Here ths Posted information from the HTTPClient:
> 
>   st=a
>   Words=java
>   Use=All
>   Town=New+York
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExec=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid
> 
> Versus the post info from the browser:
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
> 
> Well they look identical, but I noticed the missing '=' on the jrdid
> parameter.  So I did an experiment, I created a form and did a post by
> typing the URL instead of letting the form post.  Well, to the posted page
> jrdid vs. jrdid= is the difference between null and empty string.
> 
> So, in my code, I have an array of name value pairs which I do setName and
> setValue on, how do I in the last item make it append the = sign rather
than
> dropping it?  
> 
> Thanks.
> 
> Ross
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 30, 2003 1:38 PM
> To: 'Commons HttpClient Project'
> Subject: RE: Cookie Issues
> 
> Well it has changed my problem.  Here what happens now, I still do not get
> the post results that I want.  Here's the proxy trace with a browser:
> 
>   POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
>   Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/vnd.ms-excel, application/vnd.ms-powerpoint,
> application/msword, */*
>   Referer:
> http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
>   Accept-Language: en-us
>   Content-Type: application/x-www-form-urlencoded
>   User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
> 5.0.0.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
>   Host: www.careerbuilder.com
>   Content-Length: 191
>   Pragma: no-cache
>   Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A1314C4A2FA0C33F3DC0A204C3B55F8553AF
;
> bJobSeeker=True;
> CB%5FSID=e81477595a9e4a5b9d9e386d618e0b15%2D110294498%2Drh%2D1; PU=0
>   Connection: keep-alive
>   Accept-encoding: gzip, deflate
>   Browser reload detected...
>   Posting 191 bytes...
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
>   Continue ignored...
> 
>   +++RESP 12+++
>   HTTP/1.1 302 Found
>   Server: Microsoft-IIS/5.0
>   Date: Mon, 30 Jun 2003 17:23:37 GMT
>   X-Powered-By: ASP.NET
>   Connection: close
>   Set-Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A131AE9ACC050B2FDB88D31C12A6193198AB
;
> domain=.careerbuilder.com; expires=Tue, 29-Jun-2004 15:00:00 GMT;
> path=/
>   Location:
> /JobSeeker/Jobs/JobResults.asp?jrdid=&strCrit=QID%3DA3846750832018%3Bs
> t%3Da%3Buse%3DAll%3BrawWords%3Djava%3BTID%3D13938%3BBID%3DD2J8%3BCTY%3
> DNew+York%3BSID%3DNY%3BCID%3DUS%3BENR%3DNO%3BDTP%3DDR3%3BYDI%3DYES%3BI
> ND%3DAll%3BPDQ%3DAll%3BJN%3DAll%3BPAYL%3D0%3BPAYH%3Dgt120%3BPOY%3DNO%3
> BETD%3DJTFT%3BETD%3DJTCT%3BETD%3DJTIN%3BRE%3DALL%3BMGT%3DDC%3BSUP%3DDC
> %3B

Re: Posting Issues was RE: Cookie Issues

2003-07-01 Thread Oleg Kalnichevski
Ross,
I'd say giving empty string "" or a blank " " as a parameter _should_
work around the problem. Still, it does seem to be a bug in HttpClient,
and a proper fix must be implemented. I'll get back to you as soon as I
know more.

Oleg


On Tue, 2003-07-01 at 20:11, Ross Rankin wrote:
> I think I might have an idea but I don't know how to solve it...
> Here ths Posted information from the HTTPClient:
> 
>   st=a
>   Words=java
>   Use=All
>   Town=New+York
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExec=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid
> 
> Versus the post info from the browser:
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
> 
> Well they look identical, but I noticed the missing '=' on the jrdid
> parameter.  So I did an experiment, I created a form and did a post by
> typing the URL instead of letting the form post.  Well, to the posted page
> jrdid vs. jrdid= is the difference between null and empty string.
> 
> So, in my code, I have an array of name value pairs which I do setName and
> setValue on, how do I in the last item make it append the = sign rather than
> dropping it?  
> 
> Thanks.
> 
> Ross
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 30, 2003 1:38 PM
> To: 'Commons HttpClient Project'
> Subject: RE: Cookie Issues
> 
> Well it has changed my problem.  Here what happens now, I still do not get
> the post results that I want.  Here's the proxy trace with a browser:
> 
>   POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
>   Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/vnd.ms-excel, application/vnd.ms-powerpoint,
> application/msword, */*
>   Referer:
> http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
>   Accept-Language: en-us
>   Content-Type: application/x-www-form-urlencoded
>   User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
> 5.0.0.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
>   Host: www.careerbuilder.com
>   Content-Length: 191
>   Pragma: no-cache
>   Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A1314C4A2FA0C33F3DC0A204C3B55F8553AF;
> bJobSeeker=True;
> CB%5FSID=e81477595a9e4a5b9d9e386d618e0b15%2D110294498%2Drh%2D1; PU=0
>   Connection: keep-alive
>   Accept-encoding: gzip, deflate
>   Browser reload detected...
>   Posting 191 bytes...
>   st=a
>   Words=java
>   Use=All
>   Town=new+york
>   states=NY%2C+US
>   Freshness=
>   EdLevel=DR3
>   EdExc=YES
>   EmpType=JTFT
>   EmpType=JTCT
>   EmpType=JTIN
>   minsalary=0
>   maxsalary=gt120
>   vt=title
>   submit1=Search
>   sname=
>   jrdid=
>   Continue ignored...
> 
>   +++RESP 12+++
>   HTTP/1.1 302 Found
>   Server: Microsoft-IIS/5.0
>   Date: Mon, 30 Jun 2003 17:23:37 GMT
>   X-Powered-By: ASP.NET
>   Connection: close
>   Set-Cookie:
> BID=X1AF7F150CF82DEEBA4E03DAF0F931A131AE9ACC050B2FDB88D31C12A6193198AB;
> domain=.careerbuilder.com; expires=Tue, 29-Jun-2004 15:00:00 GMT;
> path=/
>   Location:
> /JobSeeker/Jobs/JobResults.asp?jrdid=&strCrit=QID%3DA3846750832018%3Bs
> t%3Da%3Buse%3DAll%3BrawWords%3Djava%3BTID%3D13938%3BBID%3DD2J8%3BCTY%3
> DNew+York%3BSID%3DNY%3BCID%3DUS%3BENR%3DNO%3BDTP%3DDR3%3BYDI%3DYES%3BI
> ND%3DAll%3BPDQ%3DAll%3BJN%3DAll%3BPAYL%3D0%3BPAYH%3Dgt120%3BPOY%3DNO%3
> BETD%3DJTFT%3BETD%3DJTCT%3BETD%3DJTIN%3BRE%3DALL%3BMGT%3DDC%3BSUP%3DDC
> %3BFRE%3D30%3BCHL%3Dal%3BQS%3Dhhr%5FJobQuery%2Easp%3BSS%3DNO%3BTITL%3D
> 0%3BVT%3Dtitle&CiBookMark=1&sname=
>   Connection: close
>   P3P: CP="CAO CURa IVAa HISa OUR IND UNI COM NAV INT
> STA",policyref="http://img.icbdr.com/images/CBP3P.xml";
>   Content-Length: 0
>   Content-Type: text/html; charset=ISO-8859-1
>   Set-Cookie: bJobSeeker=True; expires=Wed, 30-Jun-2004 17:23:36 GMT;
> domain=.careerbuilder.com; path=/
>   
> Note the 302 result with the page location I would need to get.
> However when I do a Post with the

Posting Issues was RE: Cookie Issues

2003-07-01 Thread Ross Rankin
I think I might have an idea but I don't know how to solve it...
Here ths Posted information from the HTTPClient:

st=a
Words=java
Use=All
Town=New+York
states=NY%2C+US
Freshness=
EdLevel=DR3
EdExec=YES
EmpType=JTFT
EmpType=JTCT
EmpType=JTIN
minsalary=0
maxsalary=gt120
vt=title
submit1=Search
sname=
jrdid

Versus the post info from the browser:
st=a
Words=java
Use=All
Town=new+york
states=NY%2C+US
Freshness=
EdLevel=DR3
EdExc=YES
EmpType=JTFT
EmpType=JTCT
EmpType=JTIN
minsalary=0
maxsalary=gt120
vt=title
submit1=Search
sname=
jrdid=

Well they look identical, but I noticed the missing '=' on the jrdid
parameter.  So I did an experiment, I created a form and did a post by
typing the URL instead of letting the form post.  Well, to the posted page
jrdid vs. jrdid= is the difference between null and empty string.

So, in my code, I have an array of name value pairs which I do setName and
setValue on, how do I in the last item make it append the = sign rather than
dropping it?  

Thanks.

Ross

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 30, 2003 1:38 PM
To: 'Commons HttpClient Project'
Subject: RE: Cookie Issues

Well it has changed my problem.  Here what happens now, I still do not get
the post results that I want.  Here's the proxy trace with a browser:

POST /JobSeeker/Jobs/JobQuery.asp?ch=al HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, */*
Referer:
http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp
5.0.0.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Host: www.careerbuilder.com
Content-Length: 191
Pragma: no-cache
Cookie:
BID=X1AF7F150CF82DEEBA4E03DAF0F931A1314C4A2FA0C33F3DC0A204C3B55F8553AF  ;
bJobSeeker=True;
CB%5FSID=e81477595a9e4a5b9d9e386d618e0b15%2D110294498%2Drh%2D1; PU=0
Connection: keep-alive
Accept-encoding: gzip, deflate
Browser reload detected...
Posting 191 bytes...
st=a
Words=java
Use=All
Town=new+york
states=NY%2C+US
Freshness=
EdLevel=DR3
EdExc=YES
EmpType=JTFT
EmpType=JTCT
EmpType=JTIN
minsalary=0
maxsalary=gt120
vt=title
submit1=Search
sname=
jrdid=
Continue ignored...

+++RESP 12+++
HTTP/1.1 302 Found
Server: Microsoft-IIS/5.0
Date: Mon, 30 Jun 2003 17:23:37 GMT
X-Powered-By: ASP.NET
Connection: close
Set-Cookie:
BID=X1AF7F150CF82DEEBA4E03DAF0F931A131AE9ACC050B2FDB88D31C12A6193198AB  ;
domain=.careerbuilder.com; expires=Tue, 29-Jun-2004 15:00:00 GMT;
path=/
Location:
/JobSeeker/Jobs/JobResults.asp?jrdid=&strCrit=QID%3DA3846750832018%3Bs
t%3Da%3Buse%3DAll%3BrawWords%3Djava%3BTID%3D13938%3BBID%3DD2J8%3BCTY%3
DNew+York%3BSID%3DNY%3BCID%3DUS%3BENR%3DNO%3BDTP%3DDR3%3BYDI%3DYES%3BI
ND%3DAll%3BPDQ%3DAll%3BJN%3DAll%3BPAYL%3D0%3BPAYH%3Dgt120%3BPOY%3DNO%3
BETD%3DJTFT%3BETD%3DJTCT%3BETD%3DJTIN%3BRE%3DALL%3BMGT%3DDC%3BSUP%3DDC
%3BFRE%3D30%3BCHL%3Dal%3BQS%3Dhhr%5FJobQuery%2Easp%3BSS%3DNO%3BTITL%3D
0%3BVT%3Dtitle&CiBookMark=1&sname=
Connection: close
P3P: CP="CAO CURa IVAa HISa OUR IND UNI COM NAV INT
STA",policyref="http://img.icbdr.com/images/CBP3P.xml";
Content-Length: 0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: bJobSeeker=True; expires=Wed, 30-Jun-2004 17:23:36 GMT;
domain=.careerbuilder.com; path=/

Note the 302 result with the page location I would need to get.
However when I do a Post with the HTTPClient the trace shows I get a 200 OK
back and the location in that header is the same post location I just posted
to so I get the form back again.  Any Ideas??

Ross

PS: here's the relevant trace:

2003/06/30 13:34:23:889 EDT [DEBUG] wire - ->> "POST
/JobSeeker/Jobs/jobfindall.asp?ch=al HTTP/1.0[\r][\n]"
2003/06/30 13:34:23:919 EDT [DEBUG] wire - ->> "Referer:
http://www.careerbuilder.com/JobSeeker/Jobs/JobQuery.asp?ch=al[
\r][\n]"
2003/06/30 13:34:23:989 EDT [DEBUG] wire - ->> "User-Agent: Jakarta
Commons-HttpClient/2.0beta1[\r][\n]"
2003/06/30 13:34:23:989 EDT [DEBUG] wire - ->> "Host:
www.careerbuilder.com[\r][\n]"
2003/06/30 13:34:23:989 EDT [DEBUG] wire - ->> "Cookie:
CB%5FSID=94254f4c05dc49409a412b4aa0d6b6df%2D1102

RE: Cookie Issues

2003-06-30 Thread ross_r
A",policyref="http
://img.icbdr.com/images/CBP3P.xml"[\r][\n]"
2003/06/30 13:34:24:239 EDT [DEBUG] wire - -<< "Connection:
Keep-Alive[\r][\n]"
2003/06/30 13:34:24:259 EDT [DEBUG] wire - -<< "Content-Length:
29610[\r][\n]"
2003/06/30 13:34:24:259 EDT [DEBUG] wire - -<< "Content-Type: text/html;
charset=ISO-8859-1[\r][\n]"
2003/06/30 13:34:24:259 EDT [DEBUG] wire - -<< "Set-Cookie: bJobSeeker=True;
expires=Wed, 30-Jun-2004 17:33:36 GMT; doma
in=.careerbuilder.com; path=/[\r][\n]"
2003/06/30 13:34:24:279 EDT [DEBUG] wire - -<< "Cache-control:
private[\r][\n]"
2003/06/30 13:34:24:279 EDT [DEBUG] wire - -<< "[\r][\n]"
2003/06/30 13:34:24:279 EDT [DEBUG] wire - -<<
"[0x9][0x9][0x9][\r][\n]"
2003/06/30 13:34:24:299 EDT [DEBUG] wire - -<<
"[0x9][0x9][0x9]CareerBuilder.com jobs.  Search by field of
interest, keyword, city, state, or other options and find the job you
want.[\r][\n]"

-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 4:36 PM
To: Ross Rankin
Subject: RE: Cookie Issues

Ross,
Sorry for not being clear enough. Try setting
HttpMethodBase#setStrictMode(boolean) to true.

I hope this helps

Oleg


On Fri, 2003-06-27 at 22:12, Ross Rankin wrote:
> I tried both NETSCAPE_DRAFT and RFC2109 and the trace of the post shows it
> has separate lines for each cookie.
> 
> Ross
> 
> -Original Message-
> From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 27, 2003 3:43 PM
> To: Commons HttpClient Project
> Subject: RE: Cookie Issues
> 
> Ross,
> 
> > However I noticed in my proxy traces the browser put all the cookies in
> one
> > line instead of separate lines for each cookie.  Could that cause a
> problem?
> > 
> 
> Try using strict mode. In strict mode all cookies are sent as one
> 'Cookie' header.
> 
> cheer
> 
> Oleg
> 
> 
> 
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Issues

2003-06-27 Thread Michael Becke
Hi Ross,

Strict mode is a property of the HttpMethod.  Try calling 
HttpMethod.setStrictMode(true).

Mike

On Friday, June 27, 2003, at 04:31 PM, <[EMAIL PROTECTED]> wrote:

I also didn't set a cookiePolicy and let the default go, still a 
cookie on a
separate line.  I also tried to concatenate all the cookies into a 
string
and set the cookie header line like so:
	post.setRequestHeader("Cookie",catCookies);

But that doesn't seem to work either. It is never sent.

Ross

-Original Message-
From: Ross Rankin [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 4:13 PM
To: 'Commons HttpClient Project'; '[EMAIL PROTECTED]'
Subject: RE: Cookie Issues
I tried both NETSCAPE_DRAFT and RFC2109 and the trace of the post 
shows it
has separate lines for each cookie.

Ross

-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 3:43 PM
To: Commons HttpClient Project
Subject: RE: Cookie Issues
Ross,

However I noticed in my proxy traces the browser put all the cookies 
in
one
line instead of separate lines for each cookie.  Could that cause a
problem?

Try using strict mode. In strict mode all cookies are sent as one
'Cookie' header.
cheer

Oleg



-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie

2003-06-27 Thread Oleg Kalnichevski
Zulfi, HttpClient never sends stuff it is not supposed to send. The
caller is responsible for providing the request body. HttpClient simply
transfers whatever content it is given. Please double-check your code

Oleg

On Fri, 2003-06-27 at 19:55, Zulfi Umrani wrote:
> I am using a tunnel which shows me the HTTP messages going out. It is
> showing me a character present at the end of the body,  599 times!
> Though the content-length header has the right value, but this
> particular character/byte is also present at the end of body.
> 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie

2003-06-27 Thread Zulfi Umrani
I am using a tunnel which shows me the HTTP messages going out. It is
showing me a character present at the end of the body,  599 times!
Though the content-length header has the right value, but this
particular character/byte is also present at the end of body.

>>> [EMAIL PROTECTED] 6/27/2003 3:11:00 PM >>>
The [0x0] values are just a product of the Wire log.  It interprets the

logged values as ASCII and treats all non printing ASCII values in this

way.  [0x0] corresponds to the ASCII value 0.

Mike

Zulfi Umrani wrote:
> Instead of caching HttpClient, I cached HttpState and it worked
fine.
> Now, how can I not send trailing [0x0] after each HTTP body?
> 
> Thanks.
> 
> 
[EMAIL PROTECTED] 6/27/2003 2:23:45 PM >>>
> 
> Zulfi,
> 
> First of all, Tomcat 4.0.4 can be considered fairly out-dated and is
> known to have a few bugs. Do consider upgrading.
> 
> My guess is that the version of Tomcat you are running is having
> issues
> with RFC2109 formatted cookies. Try using compatibility cookie
policy
> and see if it has any effect. Besides, you may want to examine
Tomcat
> logs for clues as to why it does not like the cookie
> 
> Oleg
> 
> On Fri, 2003-06-27 at 17:10, Zulfi Umrani wrote:
> 
>>I hung on to the HttpClient instance and seems like it is sending
>>cookies now. But it still did not work successfully, because Apache
>>Tomcat Server is returning a wiered message. When I do not send
> 
> cookies,
> 
>>it accepts the POST request. But as soon as cookie is sent, it sends
>>back 501! Attached is the wire log. I have canged the body of  HTTP
>>because of confidentiality. I also see whole bunch of [0x0]s being
> 
> added
> 
>>at the end of each body. Is there any way not to send them? Could
> 
> they
> 
>>be the cause of the problem?
>>I will appreciate a response.
>>
>>Thanks.
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED] 
> For additional commands, e-mail:
> [EMAIL PROTECTED] 
> 
> 
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED] 
> For additional commands, e-mail:
[EMAIL PROTECTED] 
> 


-
To unsubscribe, e-mail:
[EMAIL PROTECTED] 
For additional commands, e-mail:
[EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Issues

2003-06-27 Thread ross_r
I also didn't set a cookiePolicy and let the default go, still a cookie on a
separate line.  I also tried to concatenate all the cookies into a string
and set the cookie header line like so:
post.setRequestHeader("Cookie",catCookies);

But that doesn't seem to work either. It is never sent.

Ross

-Original Message-
From: Ross Rankin [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 4:13 PM
To: 'Commons HttpClient Project'; '[EMAIL PROTECTED]'
Subject: RE: Cookie Issues

I tried both NETSCAPE_DRAFT and RFC2109 and the trace of the post shows it
has separate lines for each cookie.

Ross

-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 3:43 PM
To: Commons HttpClient Project
Subject: RE: Cookie Issues

Ross,

> However I noticed in my proxy traces the browser put all the cookies in
one
> line instead of separate lines for each cookie.  Could that cause a
problem?
> 

Try using strict mode. In strict mode all cookies are sent as one
'Cookie' header.

cheer

Oleg



-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Issues

2003-06-27 Thread Ross Rankin
I tried both NETSCAPE_DRAFT and RFC2109 and the trace of the post shows it
has separate lines for each cookie.

Ross

-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 3:43 PM
To: Commons HttpClient Project
Subject: RE: Cookie Issues

Ross,

> However I noticed in my proxy traces the browser put all the cookies in
one
> line instead of separate lines for each cookie.  Could that cause a
problem?
> 

Try using strict mode. In strict mode all cookies are sent as one
'Cookie' header.

cheer

Oleg



-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Issues

2003-06-27 Thread Oleg Kalnichevski
Ross,

> However I noticed in my proxy traces the browser put all the cookies in one
> line instead of separate lines for each cookie.  Could that cause a problem?
> 

Try using strict mode. In strict mode all cookies are sent as one
'Cookie' header.

cheer

Oleg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Issues

2003-06-27 Thread ross_r
I deleted my cookies from the browser and RMID was never set again...

I don't know...  

However I noticed in my proxy traces the browser put all the cookies in one
line instead of separate lines for each cookie.  Could that cause a problem?

Ross


-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 2:54 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

Not sure about the RMID cookie.  It is never being set by the web server.

I would suggest turning off the TRACE log as it clutters up things a 
little and does not add much.

When you hit the site with a browser where does the RMID cookie get set?

Mike

[EMAIL PROTECTED] wrote:
> Nope didn't work new relevant piece of trace:
> Not in my proxy trace there seems to be one more cookie than I see in the
> trace:
> Cookie:
> BID=X1DE45D226BE57EF9DFCF03167215B4A8901B5D817388E18FAC3B90790F0B43DA2;
> bJobSeeker=True; RMID=432198953edf80d0;
> CB%5FSID=1aee5b36f209457aa530b0d72a1e8c8f%2D110026554%2Ds4%2D1; PU=0;
> CP=null
> 
> The RMID cookie.  I don't see it all in the trace even being rejected...  
> 
> 2003/06/27 14:09:08:301 EDT [DEBUG] wire - ->> "POST
> /JobSeeker/Jobs/jobfindall.asp?ch=al HTTP/1.0[\r][\n]"
> 2003/06/27 14:09:08:301 EDT [TRACE] HttpConnection - -enter
> HttpConnection.print(String)
> 2003/06/27 14:09:08:301 EDT [TRACE] HttpConnection - -enter
> HttpConnection.write(byte[])
> 2003/06/27 14:09:08:301 EDT [TRACE] HttpConnection - -enter
> HttpConnection.write(byte[], int, int)
> 2003/06/27 14:09:08:301 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
> 2003/06/27 14:09:08:301 EDT [TRACE] ExpectContinueMethod - -enter
> ExpectContinueMethod.addRequestHeaders(HttpState, Http
> Connection)
> 2003/06/27 14:09:08:341 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
> 2003/06/27 14:09:08:341 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnect
> ion)
> 2003/06/27 14:09:08:341 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
> 2003/06/27 14:09:08:341 EDT [DEBUG] HttpMethod - -Adding Host request
header
> 2003/06/27 14:09:08:341 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
> 
> 2003/06/27 14:09:08:341 EDT [TRACE] HttpState - -enter
> HttpState.getCookies()
> 2003/06/27 14:09:08:341 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.match(String, int, String, boolean, Cookie[])
> 2003/06/27 14:09:08:341 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.match(String, int, String, boolean, Cookie
> 2003/06/27 14:09:08:341 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.match(String, int, String, boolean, Cookie
> 2003/06/27 14:09:08:401 EDT [TRACE] Cookie - -enter Cookie.compare(Object,
> Object)
> 2003/06/27 14:09:08:401 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.match(String, int, String, boolean, Cookie
> 2003/06/27 14:09:08:401 EDT [TRACE] Cookie - -enter Cookie.compare(Object,
> Object)
> 2003/06/27 14:09:08:401 EDT [TRACE] Cookie - -enter Cookie.compare(Object,
> Object)
> 2003/06/27 14:09:08:401 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.match(String, int, String, boolean, Cookie
> 2003/06/27 14:09:08:401 EDT [TRACE] Cookie - -enter Cookie.compare(Object,
> Object)
> 2003/06/27 14:09:08:401 EDT [TRACE] Cookie - -enter Cookie.compare(Object,
> Object)
> 2003/06/27 14:09:08:401 EDT [TRACE] Cookie - -enter Cookie.compare(Object,
> Object)
> 2003/06/27 14:09:08:401 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookieHeader(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookie(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookieHeader(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookie(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookieHeader(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookie(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookieHeader(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] CookieSpec - -enter
> CookieSpecBase.formatCookie(Cookie)
> 2003/06/27 14:09:08:461 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.addAuthorizationRequestHeader(HttpState, HttpConn
> ection)
> 2003/06/27 14:09:08:461 EDT [TRACE] HttpMethod - -enter
> HttpMethodBase.addProxyAuthorizationRequestHeader(HttpState, Htt
> pConnection)
> 2003/06/27 14:09:08:521 EDT [TRACE] HttpMethod - -enter
> Http

Re: Cookie

2003-06-27 Thread Michael Becke
The [0x0] values are just a product of the Wire log.  It interprets the 
logged values as ASCII and treats all non printing ASCII values in this 
way.  [0x0] corresponds to the ASCII value 0.

Mike

Zulfi Umrani wrote:
Instead of caching HttpClient, I cached HttpState and it worked fine.
Now, how can I not send trailing [0x0] after each HTTP body?
Thanks.


[EMAIL PROTECTED] 6/27/2003 2:23:45 PM >>>
Zulfi,

First of all, Tomcat 4.0.4 can be considered fairly out-dated and is
known to have a few bugs. Do consider upgrading.
My guess is that the version of Tomcat you are running is having
issues
with RFC2109 formatted cookies. Try using compatibility cookie policy
and see if it has any effect. Besides, you may want to examine Tomcat
logs for clues as to why it does not like the cookie
Oleg

On Fri, 2003-06-27 at 17:10, Zulfi Umrani wrote:

I hung on to the HttpClient instance and seems like it is sending
cookies now. But it still did not work successfully, because Apache
Tomcat Server is returning a wiered message. When I do not send
cookies,

it accepts the POST request. But as soon as cookie is sent, it sends
back 501! Attached is the wire log. I have canged the body of  HTTP
because of confidentiality. I also see whole bunch of [0x0]s being
added

at the end of each body. Is there any way not to send them? Could
they

be the cause of the problem?
I will appreciate a response.
Thanks.




-
To unsubscribe, e-mail:
[EMAIL PROTECTED] 
For additional commands, e-mail:
[EMAIL PROTECTED] 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie Issues

2003-06-27 Thread Michael Becke
 14:09:08:922 EDT [TRACE] HttpConnection - -enter
HttpConnection.flushRequestOutputStream()
2003/06/27 14:09:08:922 EDT [TRACE] HttpMethod - -enter
HttpMethodBase.readResponse(HttpState, HttpConnection)
2003/06/27 14:09:08:922 EDT [TRACE] HttpMethod - -enter
HttpMethodBase.readStatusLine(HttpState, HttpConnection)
2003/06/27 14:09:08:992 EDT [TRACE] HttpConnection - -enter
HttpConnection.readLine()
2003/06/27 14:09:08:992 EDT [TRACE] HttpParser - -enter
HttpParser.readLine()
2003/06/27 14:09:08:992 EDT [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2003/06/27 14:09:09:052 EDT [DEBUG] wire - -<< "HTTP/1.1 499 Data Error
NoSessionId[\r][\n]"
2003/06/27 14:09:09:052 EDT [TRACE] HttpMethod - -enter
HttpMethodBase.readResponseHeaders(HttpState,HttpConnection)
-Original Message-
From: Ross Rankin [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 2:06 PM
To: 'Commons HttpClient Project'
Subject: RE: Cookie Issues
So a post.setRequestHeader should do the trick?  I'll give it a shot.

Ross  

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 1:51 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

The cookies appear to be working correctly. I think the problem is that 
the POST cgi requires a referer header.  Generally this is the URL of 
the page containing the HTML form doing the post.  Take a look at 
http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14 for more on the 
referer header.

Mike

Ross Rankin wrote:

Here's the trace and what my proxy says on a browser run post for
comparison.  I looked through the trace and I'm not sure what the issue
is,

I thought I might find it, but I didn't.  Thanks for any help you can
provide.
Ross

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 12:01 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

Ross,

Cookies are automatically stored in an HttpClient's instance of 
HttpState.  If you use the same instance of HttpClient to execute the 
GET on the initial page and the POST all should be automatically handled.

Please post a wire log showing the GET and POST if the cookie handling 
continues to not work (see 
http://jakarta.apache.org/commons/httpclient/logging.html).

Mike

[EMAIL PROTECTED] wrote:


I guessing that I am not doing something right.  I have a site which has a
session id that it sends as a cookie.  I get the cookie when I get the
initial page.  I then have to send a post and send that cookie back.
However I get back a error message from the server which says no session
id.


Now I did a trace and it just send back "HTTP/1.1 499 Data Error
NoSessionId" Not very helpful.  



Is there something that I need to do other than
"client.getState().getCookies" when I get the first page to make sure that
the cookies are sent back with the post data?


Thanks,



Ross Rankin








-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]

For additional commands, e-mail:
[EMAIL PROTECTED]

-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie

2003-06-27 Thread Zulfi Umrani
Instead of caching HttpClient, I cached HttpState and it worked fine.
Now, how can I not send trailing [0x0] after each HTTP body?

Thanks.

>>> [EMAIL PROTECTED] 6/27/2003 2:23:45 PM >>>
Zulfi,

First of all, Tomcat 4.0.4 can be considered fairly out-dated and is
known to have a few bugs. Do consider upgrading.

My guess is that the version of Tomcat you are running is having
issues
with RFC2109 formatted cookies. Try using compatibility cookie policy
and see if it has any effect. Besides, you may want to examine Tomcat
logs for clues as to why it does not like the cookie

Oleg

On Fri, 2003-06-27 at 17:10, Zulfi Umrani wrote:
> I hung on to the HttpClient instance and seems like it is sending
> cookies now. But it still did not work successfully, because Apache
> Tomcat Server is returning a wiered message. When I do not send
cookies,
> it accepts the POST request. But as soon as cookie is sent, it sends
> back 501! Attached is the wire log. I have canged the body of  HTTP
> because of confidentiality. I also see whole bunch of [0x0]s being
added
> at the end of each body. Is there any way not to send them? Could
they
> be the cause of the problem?
> I will appreciate a response.
> 
> Thanks.



-
To unsubscribe, e-mail:
[EMAIL PROTECTED] 
For additional commands, e-mail:
[EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie Issues

2003-06-27 Thread ross_r
nection)
2003/06/27 14:09:08:992 EDT [TRACE] HttpConnection - -enter
HttpConnection.readLine()
2003/06/27 14:09:08:992 EDT [TRACE] HttpParser - -enter
HttpParser.readLine()
2003/06/27 14:09:08:992 EDT [TRACE] HttpParser - -enter
HttpParser.readRawLine()
2003/06/27 14:09:09:052 EDT [DEBUG] wire - -<< "HTTP/1.1 499 Data Error
NoSessionId[\r][\n]"
2003/06/27 14:09:09:052 EDT [TRACE] HttpMethod - -enter
HttpMethodBase.readResponseHeaders(HttpState,HttpConnection)

-Original Message-
From: Ross Rankin [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 2:06 PM
To: 'Commons HttpClient Project'
Subject: RE: Cookie Issues

So a post.setRequestHeader should do the trick?  I'll give it a shot.

Ross  

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 1:51 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

The cookies appear to be working correctly. I think the problem is that 
the POST cgi requires a referer header.  Generally this is the URL of 
the page containing the HTML form doing the post.  Take a look at 
http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14 for more on the 
referer header.

Mike

Ross Rankin wrote:
> Here's the trace and what my proxy says on a browser run post for
> comparison.  I looked through the trace and I'm not sure what the issue
is,
> I thought I might find it, but I didn't.  Thanks for any help you can
> provide.
> 
> Ross
> 
> -Original Message-
> From: Michael Becke [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 27, 2003 12:01 PM
> To: Commons HttpClient Project
> Subject: Re: Cookie Issues
> 
> Ross,
> 
> Cookies are automatically stored in an HttpClient's instance of 
> HttpState.  If you use the same instance of HttpClient to execute the 
> GET on the initial page and the POST all should be automatically handled.
> 
> Please post a wire log showing the GET and POST if the cookie handling 
> continues to not work (see 
> http://jakarta.apache.org/commons/httpclient/logging.html).
> 
> Mike
> 
> [EMAIL PROTECTED] wrote:
> 
>>I guessing that I am not doing something right.  I have a site which has a
>>session id that it sends as a cookie.  I get the cookie when I get the
>>initial page.  I then have to send a post and send that cookie back.
>>However I get back a error message from the server which says no session
> 
> id.
> 
>>Now I did a trace and it just send back "HTTP/1.1 499 Data Error
>>NoSessionId" Not very helpful.  
>>
>> 
>>
>>Is there something that I need to do other than
>>"client.getState().getCookies" when I get the first page to make sure that
>>the cookies are sent back with the post data?
>>
>> 
>>
>>Thanks,
>>
>> 
>>
>>Ross Rankin
>>
>> 
>>
>> 
>>
>>
> 
> 
> 
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie

2003-06-27 Thread Oleg Kalnichevski
Zulfi,

First of all, Tomcat 4.0.4 can be considered fairly out-dated and is
known to have a few bugs. Do consider upgrading.

My guess is that the version of Tomcat you are running is having issues
with RFC2109 formatted cookies. Try using compatibility cookie policy
and see if it has any effect. Besides, you may want to examine Tomcat
logs for clues as to why it does not like the cookie

Oleg

On Fri, 2003-06-27 at 17:10, Zulfi Umrani wrote:
> I hung on to the HttpClient instance and seems like it is sending
> cookies now. But it still did not work successfully, because Apache
> Tomcat Server is returning a wiered message. When I do not send cookies,
> it accepts the POST request. But as soon as cookie is sent, it sends
> back 501! Attached is the wire log. I have canged the body of  HTTP
> because of confidentiality. I also see whole bunch of [0x0]s being added
> at the end of each body. Is there any way not to send them? Could they
> be the cause of the problem?
> I will appreciate a response.
> 
> Thanks.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Issues

2003-06-27 Thread Michael Becke
Yep, that should do it.

Mike

[EMAIL PROTECTED] wrote:
So a post.setRequestHeader should do the trick?  I'll give it a shot.

Ross  

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 1:51 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

The cookies appear to be working correctly. I think the problem is that 
the POST cgi requires a referer header.  Generally this is the URL of 
the page containing the HTML form doing the post.  Take a look at 
http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14 for more on the 
referer header.

Mike

Ross Rankin wrote:

Here's the trace and what my proxy says on a browser run post for
comparison.  I looked through the trace and I'm not sure what the issue
is,

I thought I might find it, but I didn't.  Thanks for any help you can
provide.
Ross

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 12:01 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

Ross,

Cookies are automatically stored in an HttpClient's instance of 
HttpState.  If you use the same instance of HttpClient to execute the 
GET on the initial page and the POST all should be automatically handled.

Please post a wire log showing the GET and POST if the cookie handling 
continues to not work (see 
http://jakarta.apache.org/commons/httpclient/logging.html).

Mike

[EMAIL PROTECTED] wrote:


I guessing that I am not doing something right.  I have a site which has a
session id that it sends as a cookie.  I get the cookie when I get the
initial page.  I then have to send a post and send that cookie back.
However I get back a error message from the server which says no session
id.


Now I did a trace and it just send back "HTTP/1.1 499 Data Error
NoSessionId" Not very helpful.  



Is there something that I need to do other than
"client.getState().getCookies" when I get the first page to make sure that
the cookies are sent back with the post data?


Thanks,



Ross Rankin








-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]

For additional commands, e-mail:
[EMAIL PROTECTED]

-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Cookie

2003-06-27 Thread Zulfi Umrani
I hung on to the HttpClient instance and seems like it is sending
cookies now. But it still did not work successfully, because Apache
Tomcat Server is returning a wiered message. When I do not send cookies,
it accepts the POST request. But as soon as cookie is sent, it sends
back 501! Attached is the wire log. I have canged the body of  HTTP
because of confidentiality. I also see whole bunch of [0x0]s being added
at the end of each body. Is there any way not to send them? Could they
be the cause of the problem?
I will appreciate a response.

Thanks.

>>> [EMAIL PROTECTED] 6/26/2003 11:29:29 PM >>>
To see the network traffic you will need to enable the wire log.  Take

a look at http://jakarta.apache.org/commons/httpclient/logging.html for

details.

HttpClient handles cookies by default.  For more details please see 
http://jakarta.apache.org/commons/httpclient/cookies.html.  If the 
cookie guide does not help to resolve the problem please post a wire 
log containing the transaction in question.

Mike

On Thursday, June 26, 2003, at 07:09 PM, Zulfi Umrani wrote:

> I enable the logging for "info", but did not get any message on the
> console. And the cookies still are not handled automatically.
>
 [EMAIL PROTECTED] 6/26/2003 9:17:57 PM >>>
>> Is there an automatic way to handle cookies?
> According to whatever less I know about HttpClient, this is the
> default
> behavior. Cookies are handled automatically. If you put the logging
on
> as given on the link
> http://jakarta.apache.org/commons/httpclient/logging.html you will
see
> some entries like
> Set-Cookie: Name=...
> Which means that HttpClient is handling cookies for you.
>
> HTH.
>
> Regards,
> Amit.
>
>> -Original Message-
>> From: Zulfi Umrani [mailto:[EMAIL PROTECTED] 
>> Sent: Friday, June 27, 2003 7:12 AM
>> To: [EMAIL PROTECTED] 
>> Subject: Cookie
>>
>> Does any one know how can I manage cookies without having to get
the
>> cookies from HttpState and setting it back everytime I make a
> request?
>> Is there an automatic way to handle cookies? Alternatively, how do
I
> put
>> a cookie header on PostMethod? I have string representation of the
>> cookie, I would like to set that as a header on PostMethod. At
> present
>> it does not allow me to do so.
>>
>> Thanks.
>>
>>
>
-
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED] 
>> For additional commands, e-mail:
>> [EMAIL PROTECTED] 
>
>
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED] 
> For additional commands, e-mail:
> [EMAIL PROTECTED] 
>
>
>
-
> To unsubscribe, e-mail: 
> [EMAIL PROTECTED] 
> For additional commands, e-mail: 
> [EMAIL PROTECTED] 
>


-
To unsubscribe, e-mail:
[EMAIL PROTECTED] 
For additional commands, e-mail:
[EMAIL PROTECTED] 

[DEBUG] wire - ->> "POST /services/dms HTTP/1.1[\r][\n]"
[DEBUG] wire - ->> "SOAPAction: "urn:dms/login"[\r][\n]"
[DEBUG] wire - ->> "Content-Type: text/xml; charset=utf-8[\r][\n]"
[DEBUG] wire - ->> "Content-Length: 522[\r][\n]"
[DEBUG] wire - ->> "User-Agent: Jakarta Commons-HttpClient/2.0beta1[\r][\n]"
[DEBUG] wire - ->> "Host: localhost:[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - ->> "[0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0]

RE: Cookie Issues

2003-06-27 Thread ross_r
So a post.setRequestHeader should do the trick?  I'll give it a shot.

Ross  

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 1:51 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

The cookies appear to be working correctly. I think the problem is that 
the POST cgi requires a referer header.  Generally this is the URL of 
the page containing the HTML form doing the post.  Take a look at 
http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14 for more on the 
referer header.

Mike

Ross Rankin wrote:
> Here's the trace and what my proxy says on a browser run post for
> comparison.  I looked through the trace and I'm not sure what the issue
is,
> I thought I might find it, but I didn't.  Thanks for any help you can
> provide.
> 
> Ross
> 
> -Original Message-
> From: Michael Becke [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 27, 2003 12:01 PM
> To: Commons HttpClient Project
> Subject: Re: Cookie Issues
> 
> Ross,
> 
> Cookies are automatically stored in an HttpClient's instance of 
> HttpState.  If you use the same instance of HttpClient to execute the 
> GET on the initial page and the POST all should be automatically handled.
> 
> Please post a wire log showing the GET and POST if the cookie handling 
> continues to not work (see 
> http://jakarta.apache.org/commons/httpclient/logging.html).
> 
> Mike
> 
> [EMAIL PROTECTED] wrote:
> 
>>I guessing that I am not doing something right.  I have a site which has a
>>session id that it sends as a cookie.  I get the cookie when I get the
>>initial page.  I then have to send a post and send that cookie back.
>>However I get back a error message from the server which says no session
> 
> id.
> 
>>Now I did a trace and it just send back "HTTP/1.1 499 Data Error
>>NoSessionId" Not very helpful.  
>>
>> 
>>
>>Is there something that I need to do other than
>>"client.getState().getCookies" when I get the first page to make sure that
>>the cookies are sent back with the post data?
>>
>> 
>>
>>Thanks,
>>
>> 
>>
>>Ross Rankin
>>
>> 
>>
>> 
>>
>>
> 
> 
> 
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Issues

2003-06-27 Thread Michael Becke
The cookies appear to be working correctly. I think the problem is that 
the POST cgi requires a referer header.  Generally this is the URL of 
the page containing the HTML form doing the post.  Take a look at 
http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14 for more on the 
referer header.

Mike

Ross Rankin wrote:
Here's the trace and what my proxy says on a browser run post for
comparison.  I looked through the trace and I'm not sure what the issue is,
I thought I might find it, but I didn't.  Thanks for any help you can
provide.
Ross

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 12:01 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

Ross,

Cookies are automatically stored in an HttpClient's instance of 
HttpState.  If you use the same instance of HttpClient to execute the 
GET on the initial page and the POST all should be automatically handled.

Please post a wire log showing the GET and POST if the cookie handling 
continues to not work (see 
http://jakarta.apache.org/commons/httpclient/logging.html).

Mike

[EMAIL PROTECTED] wrote:

I guessing that I am not doing something right.  I have a site which has a
session id that it sends as a cookie.  I get the cookie when I get the
initial page.  I then have to send a post and send that cookie back.
However I get back a error message from the server which says no session
id.

Now I did a trace and it just send back "HTTP/1.1 499 Data Error
NoSessionId" Not very helpful.  



Is there something that I need to do other than
"client.getState().getCookies" when I get the first page to make sure that
the cookies are sent back with the post data?


Thanks,



Ross Rankin








-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Cookie Issues

2003-06-27 Thread Ross Rankin
Here's the trace and what my proxy says on a browser run post for
comparison.  I looked through the trace and I'm not sure what the issue is,
I thought I might find it, but I didn't.  Thanks for any help you can
provide.

Ross

-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 27, 2003 12:01 PM
To: Commons HttpClient Project
Subject: Re: Cookie Issues

Ross,

Cookies are automatically stored in an HttpClient's instance of 
HttpState.  If you use the same instance of HttpClient to execute the 
GET on the initial page and the POST all should be automatically handled.

Please post a wire log showing the GET and POST if the cookie handling 
continues to not work (see 
http://jakarta.apache.org/commons/httpclient/logging.html).

Mike

[EMAIL PROTECTED] wrote:
> I guessing that I am not doing something right.  I have a site which has a
> session id that it sends as a cookie.  I get the cookie when I get the
> initial page.  I then have to send a post and send that cookie back.
> However I get back a error message from the server which says no session
id.
> Now I did a trace and it just send back "HTTP/1.1 499 Data Error
> NoSessionId" Not very helpful.  
> 
>  
> 
> Is there something that I need to do other than
> "client.getState().getCookies" when I get the first page to make sure that
> the cookies are sent back with the post data?
> 
>  
> 
> Thanks,
> 
>  
> 
> Ross Rankin
> 
>  
> 
>  
> 
> 


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]



traces.zip
Description: Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Cookie Issues

2003-06-27 Thread Michael Becke
Ross,

Cookies are automatically stored in an HttpClient's instance of 
HttpState.  If you use the same instance of HttpClient to execute the 
GET on the initial page and the POST all should be automatically handled.

Please post a wire log showing the GET and POST if the cookie handling 
continues to not work (see 
http://jakarta.apache.org/commons/httpclient/logging.html).

Mike

[EMAIL PROTECTED] wrote:
I guessing that I am not doing something right.  I have a site which has a
session id that it sends as a cookie.  I get the cookie when I get the
initial page.  I then have to send a post and send that cookie back.
However I get back a error message from the server which says no session id.
Now I did a trace and it just send back "HTTP/1.1 499 Data Error
NoSessionId" Not very helpful.  

 

Is there something that I need to do other than
"client.getState().getCookies" when I get the first page to make sure that
the cookies are sent back with the post data?
 

Thanks,

 

Ross Rankin

 

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Cookie

2003-06-27 Thread Kalnichevski, Oleg
> Does any one know how can I manage cookies without having to get the
> cookies from HttpState and setting it back everytime I make a request?

Just keep the HttpState instance.

> Is there an automatic way to handle cookies? Alternatively, how do I put
> a cookie header on PostMethod? I have string representation of the
> cookie, I would like to set that as a header on PostMethod. At present
> it does not allow me to do so.

Cookies are managed by HttpClient based on the content of HttpState. That is why 
setting 'Cookie' header manually does not really help, as 'Cookie' headers 
automatically generated by HttpClient always overwrite those set manually. Bottom 
line: always add your cookies to HttpState. Never set them manually.

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie

2003-06-26 Thread Michael Becke
To see the network traffic you will need to enable the wire log.  Take 
a look at http://jakarta.apache.org/commons/httpclient/logging.html for 
details.

HttpClient handles cookies by default.  For more details please see 
http://jakarta.apache.org/commons/httpclient/cookies.html.  If the 
cookie guide does not help to resolve the problem please post a wire 
log containing the transaction in question.

Mike

On Thursday, June 26, 2003, at 07:09 PM, Zulfi Umrani wrote:

I enable the logging for "info", but did not get any message on the
console. And the cookies still are not handled automatically.
[EMAIL PROTECTED] 6/26/2003 9:17:57 PM >>>
Is there an automatic way to handle cookies?
According to whatever less I know about HttpClient, this is the
default
behavior. Cookies are handled automatically. If you put the logging on
as given on the link
http://jakarta.apache.org/commons/httpclient/logging.html you will see
some entries like
Set-Cookie: Name=...
Which means that HttpClient is handling cookies for you.
HTH.

Regards,
Amit.
-Original Message-
From: Zulfi Umrani [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 7:12 AM
To: [EMAIL PROTECTED]
Subject: Cookie
Does any one know how can I manage cookies without having to get the
cookies from HttpState and setting it back everytime I make a
request?
Is there an automatic way to handle cookies? Alternatively, how do I
put
a cookie header on PostMethod? I have string representation of the
cookie, I would like to set that as a header on PostMethod. At
present
it does not allow me to do so.

Thanks.


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Cookie

2003-06-26 Thread Zulfi Umrani
I enable the logging for "info", but did not get any message on the
console. And the cookies still are not handled automatically.

>>> [EMAIL PROTECTED] 6/26/2003 9:17:57 PM >>>
> Is there an automatic way to handle cookies?
According to whatever less I know about HttpClient, this is the
default
behavior. Cookies are handled automatically. If you put the logging on
as given on the link
http://jakarta.apache.org/commons/httpclient/logging.html you will see
some entries like
Set-Cookie: Name=...
Which means that HttpClient is handling cookies for you.

HTH.

Regards,
Amit.

> -Original Message-
> From: Zulfi Umrani [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 27, 2003 7:12 AM
> To: [EMAIL PROTECTED] 
> Subject: Cookie
> 
> Does any one know how can I manage cookies without having to get the
> cookies from HttpState and setting it back everytime I make a
request?
> Is there an automatic way to handle cookies? Alternatively, how do I
put
> a cookie header on PostMethod? I have string representation of the
> cookie, I would like to set that as a header on PostMethod. At
present
> it does not allow me to do so.
> 
> Thanks.
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED] 
> For additional commands, e-mail:
> [EMAIL PROTECTED] 


-
To unsubscribe, e-mail:
[EMAIL PROTECTED] 
For additional commands, e-mail:
[EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie

2003-06-26 Thread Amit Rana
> Is there an automatic way to handle cookies?
According to whatever less I know about HttpClient, this is the default
behavior. Cookies are handled automatically. If you put the logging on
as given on the link
http://jakarta.apache.org/commons/httpclient/logging.html you will see
some entries like
Set-Cookie: Name=...
Which means that HttpClient is handling cookies for you.

HTH.

Regards,
Amit.

> -Original Message-
> From: Zulfi Umrani [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 27, 2003 7:12 AM
> To: [EMAIL PROTECTED]
> Subject: Cookie
> 
> Does any one know how can I manage cookies without having to get the
> cookies from HttpState and setting it back everytime I make a request?
> Is there an automatic way to handle cookies? Alternatively, how do I
put
> a cookie header on PostMethod? I have string representation of the
> cookie, I would like to set that as a header on PostMethod. At present
> it does not allow me to do so.
> 
> Thanks.
> 
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie and RFC 2109

2003-06-12 Thread Oleg Kalnichevski
Fix applied. Please re-test against the most recent CVS snapshot

Oleg

On Thu, 2003-06-12 at 18:52, Kalnichevski, Oleg wrote:
> Dan
> I have to confirm that this is indeed a bug in HttpClient. The bug only affects 
> cookie paths that have one leading back slash, eg: '/whatever.php'. Cookie paths 
> with multiple slashes are processed correctly, eg: '/path/whatever.php'.
> 
> Many thanks for tracking the bug down
> 
> Cheers
> 
> Oleg
> 
> 
> -Original Message-
> From: Dan Åberg [mailto:[EMAIL PROTECTED]
> Sent: Thu 6/12/2003 10:37
> To:   commons-httpclient-dev
> Cc:   
> Subject:  Cookie and RFC 2109
> Hi All !
> 
> RFC 2109, section: "4.3.1 Interpreting Set-Cookie" states that:
> 
> "Path   Defaults to the path of the request URL that generated the
> Set-Cookie response, up to, but not including, the
> right-most /."
> 
> When I'm using HttpClient and PostMethod to issue a post command to 
> http://foo.com/whatever.php I retreive a cookie with no path set. When I examine the 
> cookie the path is set to "/whatever.php", but according to RFC 2109 it should be 
> "/".
> Am I missing something or is this a bug ?
> 
> Thanx
> /Dan
> 
> P.S.
> I'm using version commons-httpclient-2.0-beta1
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 
> 
> 
> __
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie and RFC 2109

2003-06-12 Thread Kalnichevski, Oleg
Dan
I have to confirm that this is indeed a bug in HttpClient. The bug only affects cookie 
paths that have one leading back slash, eg: '/whatever.php'. Cookie paths with 
multiple slashes are processed correctly, eg: '/path/whatever.php'.

Many thanks for tracking the bug down

Cheers

Oleg


-Original Message-
From:   Dan Åberg [mailto:[EMAIL PROTECTED]
Sent:   Thu 6/12/2003 10:37
To: commons-httpclient-dev
Cc: 
Subject:Cookie and RFC 2109
Hi All !

RFC 2109, section: "4.3.1 Interpreting Set-Cookie" states that:

"Path   Defaults to the path of the request URL that generated the
Set-Cookie response, up to, but not including, the
right-most /."

When I'm using HttpClient and PostMethod to issue a post command to 
http://foo.com/whatever.php I retreive a cookie with no path set. When I examine the 
cookie the path is set to "/whatever.php", but according to RFC 2109 it should be "/".
Am I missing something or is this a bug ?

Thanx
/Dan

P.S.
I'm using version commons-httpclient-2.0-beta1


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Cookie and RFC 2109

2003-06-12 Thread Kalnichevski, Oleg
Dan,
That would definitely be a bug. However, it would be too obvious and too massive a bug 
to be so easily overlooked by the time of beta-1. Would it be possible to provide us 
with the wire log of the HTTP session that exhibits the problem? Meanwhile, I will 
walk through cookie management code in order to double-check if everything is ok there

http://jakarta.apache.org/commons/httpclient/logging.html

Cheers

Oleg

-Original Message-
From: Dan Åberg [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 10:37
To: commons-httpclient-dev
Subject: Cookie and RFC 2109


Hi All !

RFC 2109, section: "4.3.1 Interpreting Set-Cookie" states that:

"Path   Defaults to the path of the request URL that generated the
Set-Cookie response, up to, but not including, the
right-most /."

When I'm using HttpClient and PostMethod to issue a post command to 
http://foo.com/whatever.php I retreive a cookie with no path set. When I examine the 
cookie the path is set to "/whatever.php", but according to RFC 2109 it should be "/".
Am I missing something or is this a bug ?

Thanx
/Dan

P.S.
I'm using version commons-httpclient-2.0-beta1


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Header String

2003-03-02 Thread Oleg Kalnichevski
Ross,
Just use strict mode. That will make HttpClient put all cookies into one
header
Oleg

On Sun, 2003-03-02 at 21:38, Ross Rankin wrote:
> I had a new problem today, but unlike my last one, I figured it out today.
> But I was wondering if it the way the HttpClient works, a setting, or
> something I should be doing.
> 
> The HttpClient is creating a header like this:
> 
> Cookie: cookie1=blah1
> 
> Cookie: cookie2=blah2
> 
> Cookie: cookie3-blah3
> 
> Cookie: cookie4=blah4
> 
>  
> 
> But the browser sends cookies like this:
> 
> Cookie: cookie1=blah1; cookie2=blah2; cookie3=blah3; cookie4=blah4
> 
>  
> 
> Right now I cam just getting the cookies and creating a response header with
> the array concatenated into the above format and the server accepts it.  
> 
> Is there an easier way?
> 
>  
> 
> Ross
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cookie issues...

2003-02-26 Thread Ross Rankin
Here's the log...  

I noticed three things, one: cookies are being rejected due to a leading .
in the domain name,  two: there is a CLIENT=null in there, three: there is a
follow redirect is disable when I have enabled it in both the posts and
gets.  

Ross

-Original Message-
From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 26, 2003 1:37 PM
To: Commons HttpClient Project
Subject: Re: Cookie issues...

Ross
I think I'll be able to help you out. I just need more detailed
information on what is going on inside HttpClient. Could you please
execute your application with the following system settings and send me
back the resulting debug trace

-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug 
-Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=deb
ug

Cheers

Oleg

On Wed, 2003-02-26 at 18:58, Ross Rankin wrote:
> I am running the alpha 3 version of the client and I am see some odd
> differences between what I see using OpenSTA and tracing a connection and
> getting cookies and then what happens on my HTTPClient connection.  
> It seems to revolve around cookies with multiple crumbs in the same cookie
> name.  For example:
> The cookie is the following:
> 
>   CLIENT=sid=9964612&cid=469406&uid=1216042; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT; domain=.website.com
> 
> But when I do a write out the response headers I get this:
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: CLIENT=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT; domain=.website.com
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: CLIENT=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT;
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: client=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT; domain=.website.com
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: client=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT;
> 
> I even tried an add cookie with the above information and the information
> remains the same.  Any ideas on what I am doing wrong or if the cookie is
> the problem or what?  This site will not let me login without the CLIENT
> cookie.  Anything I can do to get around it?
> 
> 
> Ross Rankin
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
 
2003/02/26 13:57:16:427 EST [TRACE] GetMethod - -enter GetMethod(String)
2003/02/26 13:57:16:429 EST [TRACE] HttpClient - -enter 
HttpClient.executeMethod(HttpMethod)
2003/02/26 13:57:18:050 EST [TRACE] HttpClient - -enter 
HttpClient.executeMethod(HostConfiguration,HttpMethod)
2003/02/26 13:57:18:079 EST [DEBUG] HttpConnection - 
-HttpConnectionManager.getConnection:  creating  connection for www.website.com:80 via 
null:-1 using protocol: http:80
2003/02/26 13:57:18:080 EST [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0)
2003/02/26 13:57:18:081 EST [TRACE] HttpConnection - -enter HttpConnection.open()
2003/02/26 13:57:18:106 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.execute(HttpState, HttpConnection)
2003/02/26 13:57:18:384 EST [TRACE] Authenticator - -enter 
Authenticator.authenticate(HttpMethod, HttpState)
2003/02/26 13:57:18:386 EST [TRACE] Authenticator - -enter 
Authenticator.authenticate(HttpMethod, HttpState, Header, String)
2003/02/26 13:57:18:387 EST [DEBUG] HttpMethod - -Execute loop try 1
2003/02/26 13:57:18:387 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.processRequest(HttpState, HttpConnection)
2003/02/26 13:57:18:388 EST [TRACE] HttpMethod - -Attempt number 1 to write request
2003/02/26 13:57:18:388 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.writeRequest(HttpState, HttpConnection)
2003/02/26 13:57:18:389 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
2003/02/26 13:57:18:389 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String)
2003/02/26 13:57:18:401 EST [TRACE] HttpConnection - -enter 
HttpConnection.print(String)
2003/02/26 13:57:18:407 EST [TRACE] HttpConnection - -enter 
HttpConnection.write(byte[])
2003/02/26 13:57:18:408 EST [TRACE] HttpConnection - -enter 
HttpConnection.write(byte[], int, int)
2003/02/26 13:57:18:408 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
2003/02/26 13:57:18:409 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
2003/02/26 13:57:18:409 EST [TRACE] HttpMethod - -enter 
HttpMethodBase.addUserAgentRequestHeaders(HttpSta

Re: Cookie issues...

2003-02-26 Thread Oleg Kalnichevski
Ross
I think I'll be able to help you out. I just need more detailed
information on what is going on inside HttpClient. Could you please
execute your application with the following system settings and send me
back the resulting debug trace

-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug 
-Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=debug

Cheers

Oleg

On Wed, 2003-02-26 at 18:58, Ross Rankin wrote:
> I am running the alpha 3 version of the client and I am see some odd
> differences between what I see using OpenSTA and tracing a connection and
> getting cookies and then what happens on my HTTPClient connection.  
> It seems to revolve around cookies with multiple crumbs in the same cookie
> name.  For example:
> The cookie is the following:
> 
>   CLIENT=sid=9964612&cid=469406&uid=1216042; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT; domain=.website.com
> 
> But when I do a write out the response headers I get this:
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: CLIENT=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT; domain=.website.com
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: CLIENT=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT;
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: client=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT; domain=.website.com
> 
> Wed Feb 26 12:43:13 EST 2003,Set-Cookie: client=; path=/; expires=Friday,
> 1-Sep-2000 00:00:00 GMT;
> 
> I even tried an add cookie with the above information and the information
> remains the same.  Any ideas on what I am doing wrong or if the cookie is
> the problem or what?  This site will not let me login without the CLIENT
> cookie.  Anything I can do to get around it?
> 
> 
> Ross Rankin
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie with max age...

2003-02-04 Thread Oleg Kalnichevski
Alan

I suppose you want to have a cookie that never expires. Currently
Cookie#Cookie(String, String, String, String, int, boolean) constructor
blindly assumes max age parameter to be a positive integer. To work the
problem around you can use Cookie#Cookie(String, String, String, String,
Date, boolean) constructor and pass null as expiry date parameter

Hope this helps

Oleg


On Tue, 2003-02-04 at 18:04, Alan Marcinkowski wrote:
> ...When I pass a Cookie that has max age set to -1 to the HttpState 
> addCookie, it thinks its expired (verified by the Cookie.isExpired) call 
> when clearly it isn't supposed to be. It won't put it in the request. 
> Any ideas?
> 
> Thanks.
> 
> Alan
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]