You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Narayanan Unny E <na...@strandgenomics.com> on 2003/05/06 07:55:29 UTC

Cookie problem with strict mode

Hi,
i am using httpclient2.0alpha3 to make queries to the pubmed site. The
site expects multiple cookies to be appended by a semi-colon. So i have
set strict mode to tru to enable the feature. But then the addition of
cookies behave in a strange way. Below, is the log from a proxy through
which the requests were sent -

------------------------------------------------------------------------
Connection from 127.0.0.1  port: 40664
Request for URL:
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=search&term=human
Connecting to 130.14.29.110 port 80.

GET /entrez/query.fcgi?db=PubMed&cmd=search&term=human HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/2.0alpha3
Host: www.ncbi.nlm.nih.gov

 --- Done sending. Response:

 HTTP/1.1 200 OK
 Date: Tue, 06 May 2003 05:35:54 GMT
 Server: Apache
 Set-Cookie: LB-Hint-PubMed=0T1yFm7sdmQnp1gNM5T; domain=.nlm.nih.gov;
 path=/; expires=Tue, 06-May-2003 05:40:55 GMT
 Set-Cookie: WebEnv=0KwkCGYFqHtneF8NM0ma0WFnL2J7js3vxTsVWhDsptqi-DkXMyWR5G;
 domain=.nlm.nih.gov; path=/; expires=Tue, 06-May-2003 06:35:55 GMT
 Content-Type: text/html
 Via: 1.1 www.ncbi.nih.gov
 X-Cache: MISS from www.ncbi.nih.gov
 Transfer-Encoding: chunked
 
------------------------------------------------------------------------
As you can see two cookies were received. Now, notice how the cookies
are sent when consecutive queries are made.

------------------------------------------------------------------------
 --- Waiting to be of service ...
 Connection from 127.0.0.1  port: 40667
 Request for URL:
 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Text&query_key=1&dopt=uilist&sort=PublicationDate&dispmax=30&SendTo=Text&textpage=1&page=1
 Connecting to 130.14.29.110 port 80.

 GET /entrez/query.fcgi?db=PubMed&cmd=Text&query_key=1&dopt=uilist&sort=PublicationDate&dispmax=30&SendTo=Text&textpage=1&page=1
 HTTP/1.1
 User-Agent: Jakarta Commons-HttpClient/2.0alpha3
 Host: www.ncbi.nlm.nih.gov
 Cookie: LB-Hint-PubMed=0T1yFm7sdmQnp1gNM5T; WebEnv=0KwkCGYFqHtneF8NM0ma0WFnL2J7js3vxTsVWhDsptqi-DkXMyWR5G
 Cookie: LB-Hint-PubMed=0T1yFm7sdmQnp1gNM5T; WebEnv=0KwkCGYFqHtneF8NM0ma0WFnL2J7js3vxTsVWhDsptqi-DkXMyWR5G
------------------------------------------------------------------------------ 
 --- Done sending. Response:

 HTTP/1.1 500 Internal Server Error
 Date: Tue, 06 May 2003 05:36:10 GMT
 Server: Apache
 Content-Type: text/html
 Via: 1.1 www.ncbi.nih.gov
 X-Cache: MISS from www.ncbi.nih.gov
 Connection: close
 Transfer-Encoding: chunked

  --- Waiting to be of service ...
  Connection from 127.0.0.1  port: 40669
  Request for URL:
  http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=Text&query_key=1&dopt=uilist&sort=PublicationDate&dispmax=30&SendTo=Text&textpage=1&page=2
  Connecting to 130.14.29.110 port 80.

  GET  /entrez/query.fcgi?db=PubMed&cmd=Text&query_key=1&dopt=uilist&sort=PublicationDate&dispmax=30&SendTo=Text&textpage=1&page=2
  HTTP/1.1
  User-Agent: Jakarta Commons-HttpClient/2.0alpha3
  Host: www.ncbi.nlm.nih.gov
  Cookie: LB-Hint-PubMed=0T1yFm7sdmQnp1gNM5T;  WebEnv=0KwkCGYFqHtneF8NM0ma0WFnL2J7js3vxTsVWhDsptqi-DkXMyWR5G

   --- Done sending. Response:

   HTTP/1.1 200 OK
   Date: Tue, 06 May 2003 05:36:12 GMT
   Server: Apache
   Set-Cookie: LB-Hint-PubMed=0FLDOYsmxiMMQ0BBD5q; domain=.nlm.nih.gov;
   path=/; expires=Tue, 06-May-2003 05:41:13 GMT
   Set-Cookie: WebEnv=0aFbcdwWMA6fTL961MgoGTs8bXoWaKKWeBxRiBnTCeyqHTdfcZ3NAB;
   domain=.nlm.nih.gov; path=/; expires=Tue, 06-May-2003 06:36:13 GMT
   Content-Type: text/html
   Via: 1.1 www.ncbi.nih.gov
   X-Cache: MISS from www.ncbi.nih.gov
   Transfer-Encoding: chunked
-----------------------------------------------------------------
The same cookies are sent twice. But when i make the second query, this
time with page=2, notice how the problem dissapears.
I have tried all the cookie policies. NETSCAPE_DRAFT and COMPATIBILTIY
give the same result. The other one rejects the cookies. I tried the
same thing with a browser, it was working fine. Can anyone please help
me with this problem.

--------------------------------------------------------------------------


Narayanan Unny E
Strand Genomics
res : (080)56695165
office : (080)3618992-5 Extn : 305
url : www.geocities.com/narayanan_unny