~ubuntu-branches/ubuntu/lucid/commons-httpclient/lucid

« back to all changes in this revision

Viewing changes to docs/cookies.html

  • Committer: Bazaar Package Importer
  • Author(s): Barry Hawkins
  • Date: 2005-11-25 13:12:23 UTC
  • Revision ID: james.westby@ubuntu.com-20051125131223-2g7eyo21pqgrohpo
Tags: upstream-2.0.2
Import upstream version 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
  
 
3
 
 
4
  
 
5
  
 
6
 
 
7
  
 
8
  
 
9
 
 
10
  
 
11
 
 
12
  
 
13
  
 
14
 
 
15
  
 
16
  
 
17
 
 
18
  
 
19
  
 
20
 
 
21
  
 
22
 
 
23
  
 
24
 
 
25
  
 
26
 
 
27
  
 
28
 
 
29
  
 
30
 
 
31
  
 
32
  
 
33
  
 
34
  
 
35
      
 
36
  
 
37
 
 
38
      
 
39
      
 
40
      
 
41
      
 
42
      
 
43
      
 
44
        
 
45
         
 
46
      
 
47
      
 
48
 
 
49
      
 
50
      
 
51
      
 
52
      
 
53
 
 
54
      
 
55
      
 
56
      
 
57
 
 
58
      
 
59
 
 
60
  
 
61
  
 
62
 
 
63
  
 
64
  
 
65
 
 
66
   
 
67
   
 
68
 
 
69
   
 
70
   
 
71
 
 
72
 
 
73
    
 
74
        
 
75
        
 
76
 
 
77
    
 
78
    
 
79
      
 
80
        
 
81
        
 
82
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
83
 
 
84
    <html>
 
85
      <head>
 
86
        
 
87
        
 
88
        
 
89
          <title>HttpClient - 
 
90
          HttpClient Cookie Guide
 
91
        </title>
 
92
        
 
93
        
 
94
        <style type="text/css">
 
95
          @import url("http://jakarta.apache.org/commons/style/tigris.css");
 
96
          @import url("http://jakarta.apache.org/commons/style/maven.css");
 
97
          @import url("http://jakarta.apache.org/commons/style/project.css");
 
98
        </style>
 
99
        
 
100
          
 
101
        
 
102
        
 
103
        
 
104
        <link rel="stylesheet" href="http://jakarta.apache.org/commons/style/print.css" type="text/css" media="print"></link>
 
105
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta>
 
106
        
 
107
          <meta name="author" content="Adrian Sutton"></meta>
 
108
          <meta name="email" content="adrian@intencha.com"></meta>
 
109
        
 
110
          <meta name="author" content="Oleg Kalnichevski"></meta>
 
111
          <meta name="email" content="oleg@ural.ru"></meta>
 
112
        
 
113
        
 
114
        
 
115
        
 
116
      </head>
 
117
 
 
118
      <body class="composite">
 
119
 
 
120
        <div id="banner">
 
121
          <table border="0" width="100%" cellpadding="8" cellspacing="0">
 
122
            <tr>
 
123
              
 
124
              <td>
 
125
                
 
126
                
 
127
                  
 
128
                  
 
129
                  
 
130
                    
 
131
                  
 
132
                  
 
133
                  
 
134
                  
 
135
                  
 
136
                  <a href="http://jakarta.apache.org/">
 
137
                    <img border="0" alt="Apache Software Foundation" src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left"></img>
 
138
                  </a>
 
139
                
 
140
              </td>
 
141
 
 
142
              
 
143
              <td>
 
144
                <div id="login" align="right">
 
145
                  
 
146
                  
 
147
                    
 
148
                    
 
149
                    
 
150
                      
 
151
                    
 
152
 
 
153
                    <a href="http://jakarta.apache.org/commons/httpclient/">
 
154
                      <img border="0" alt="HttpClient" src="./images/httpclient_logo.png" align="right"></img>
 
155
                    </a>
 
156
                  
 
157
                </div>
 
158
              </td>
 
159
            </tr>
 
160
          </table>
 
161
        </div>
 
162
        <div id="breadcrumbs">
 
163
          <table border="0" width="100%" cellpadding="4" cellspacing="0">
 
164
            <tr>
 
165
              
 
166
                
 
167
                <td>Last published: 10 October 2004
 
168
                  | Doc for 2.0.2
 
169
                </td>
 
170
              
 
171
              <td>
 
172
                <div align="right">
 
173
                  
 
174
                  
 
175
                  
 
176
                  
 
177
                    
 
178
                  
 
179
                </div>
 
180
              </td>
 
181
            </tr>
 
182
          </table>
 
183
        </div>
 
184
        
 
185
        <table border="0" width="100%" cellpadding="8" cellspacing="0"> 
 
186
          <tr valign="top">
 
187
            <td width="20%" id="leftcol">
 
188
              <div id="navcolumn">
 
189
                
 
190
 
 
191
                                
 
192
    <div>
 
193
      <strong>About Us</strong>
 
194
      
 
195
    
 
196
    
 
197
    
 
198
    
 
199
        
 
200
        
 
201
        
 
202
        
 
203
        
 
204
                   
 
205
        
 
206
    <div>
 
207
      <small>
 
208
        
 
209
        
 
210
                <a href="http://jakarta.apache.org/commons/" class="externalLink" title="External Link">Home</a>
 
211
        
 
212
      </small>
 
213
          
 
214
        
 
215
      
 
216
    </div>
 
217
  
 
218
    
 
219
    
 
220
    
 
221
    
 
222
        
 
223
        
 
224
        
 
225
        
 
226
        
 
227
                   
 
228
        
 
229
    <div>
 
230
      <small>
 
231
        
 
232
        
 
233
                <a href="http://jakarta.apache.org/commons/contributors.html" class="externalLink" title="External Link">Contributors</a>
 
234
        
 
235
      </small>
 
236
          
 
237
        
 
238
      
 
239
    </div>
 
240
  
 
241
    
 
242
    
 
243
    
 
244
    
 
245
        
 
246
        
 
247
        
 
248
        
 
249
        
 
250
                   
 
251
        
 
252
    <div>
 
253
      <small>
 
254
        
 
255
        
 
256
                <a href="http://jakarta.apache.org/commons/license.html" class="externalLink" title="External Link">License</a>
 
257
        
 
258
      </small>
 
259
          
 
260
        
 
261
      
 
262
    </div>
 
263
  
 
264
    
 
265
    
 
266
    
 
267
    
 
268
        
 
269
        
 
270
        
 
271
        
 
272
        
 
273
                
 
274
                
 
275
          
 
276
                
 
277
        
 
278
                   
 
279
        
 
280
    <div>
 
281
      <small>
 
282
        
 
283
        
 
284
                <a href="http://jakarta.apache.org/commons/components.html" class="externalLink" title="External Link">Components</a>
 
285
        
 
286
      </small>
 
287
          
 
288
    </div>
 
289
  
 
290
    
 
291
    
 
292
    
 
293
    
 
294
        
 
295
        
 
296
        
 
297
        
 
298
        
 
299
                
 
300
                
 
301
          
 
302
                
 
303
        
 
304
                   
 
305
        
 
306
    <div>
 
307
      <small>
 
308
        
 
309
        
 
310
                <a href="http://jakarta.apache.org/commons/sandbox/index.html" class="externalLink" title="External Link">Sandbox</a>
 
311
        
 
312
      </small>
 
313
          
 
314
    </div>
 
315
  
 
316
    </div>
 
317
  
 
318
                
 
319
    <div>
 
320
      <strong>Overview</strong>
 
321
      
 
322
    
 
323
    
 
324
    
 
325
    
 
326
        
 
327
        
 
328
        
 
329
        
 
330
        
 
331
                   
 
332
        
 
333
    <div>
 
334
      <small>
 
335
        
 
336
        
 
337
                <a href="3.0/index.html">HttpClient 3.0</a>
 
338
        
 
339
      </small>
 
340
          
 
341
        
 
342
      
 
343
    </div>
 
344
  
 
345
    
 
346
    
 
347
    
 
348
    
 
349
        
 
350
        
 
351
        
 
352
        
 
353
        
 
354
                   
 
355
        
 
356
    <div>
 
357
      <small>
 
358
        
 
359
        
 
360
                <a href="features.html">Features</a>
 
361
        
 
362
      </small>
 
363
          
 
364
        
 
365
      
 
366
    </div>
 
367
  
 
368
    
 
369
    
 
370
    
 
371
    
 
372
        
 
373
        
 
374
        
 
375
        
 
376
        
 
377
                   
 
378
        
 
379
    <div>
 
380
      <small>
 
381
        
 
382
        
 
383
                <a href="news.html">News</a>
 
384
        
 
385
      </small>
 
386
          
 
387
        
 
388
      
 
389
    </div>
 
390
  
 
391
    
 
392
    
 
393
    
 
394
    
 
395
        
 
396
        
 
397
        
 
398
        
 
399
        
 
400
                   
 
401
        
 
402
    <div>
 
403
      <small>
 
404
        
 
405
        
 
406
                <a href="status.html">Status</a>
 
407
        
 
408
      </small>
 
409
          
 
410
        
 
411
      
 
412
    </div>
 
413
  
 
414
    
 
415
    
 
416
    
 
417
    
 
418
        
 
419
        
 
420
        
 
421
        
 
422
        
 
423
                   
 
424
        
 
425
    <div>
 
426
      <small>
 
427
        
 
428
        
 
429
                <a href="downloads.html">Download</a>
 
430
        
 
431
      </small>
 
432
          
 
433
        
 
434
      
 
435
    </div>
 
436
  
 
437
    
 
438
    
 
439
    
 
440
    
 
441
        
 
442
        
 
443
        
 
444
        
 
445
        
 
446
                   
 
447
        
 
448
    <div>
 
449
      <small>
 
450
        
 
451
        
 
452
                <a href="applications.html">Applications</a>
 
453
        
 
454
      </small>
 
455
          
 
456
        
 
457
      
 
458
    </div>
 
459
  
 
460
    
 
461
    
 
462
    
 
463
    
 
464
        
 
465
        
 
466
        
 
467
        
 
468
        
 
469
                
 
470
          
 
471
                
 
472
                
 
473
        
 
474
                   
 
475
        
 
476
    <div>
 
477
      <small>
 
478
        
 
479
        
 
480
                <a href="userguide.html">User Guide</a>
 
481
        
 
482
      </small>
 
483
          
 
484
        
 
485
    
 
486
    
 
487
    
 
488
    
 
489
        
 
490
        
 
491
        
 
492
        
 
493
        
 
494
                   
 
495
        
 
496
    <div>
 
497
      <small>
 
498
        
 
499
        
 
500
                <a href="authentication.html">Authentication Guide</a>
 
501
        
 
502
      </small>
 
503
          
 
504
        
 
505
      
 
506
    </div>
 
507
  
 
508
    
 
509
    
 
510
    
 
511
    
 
512
        
 
513
        
 
514
        
 
515
        
 
516
        
 
517
                   
 
518
        
 
519
    <div>
 
520
      <small>
 
521
        
 
522
        
 
523
                <a href="charencodings.html">Character Encodings</a>
 
524
        
 
525
      </small>
 
526
          
 
527
        
 
528
      
 
529
    </div>
 
530
  
 
531
    
 
532
    
 
533
    
 
534
    
 
535
        
 
536
        
 
537
        
 
538
        
 
539
        
 
540
                   
 
541
        
 
542
    <div>
 
543
      <small>
 
544
        
 
545
                <b><a href="cookies.html">Cookies</a></b>
 
546
        
 
547
        
 
548
      </small>
 
549
          
 
550
        
 
551
      
 
552
    </div>
 
553
  
 
554
    
 
555
    
 
556
    
 
557
    
 
558
        
 
559
        
 
560
        
 
561
        
 
562
        
 
563
                   
 
564
        
 
565
    <div>
 
566
      <small>
 
567
        
 
568
        
 
569
                <a href="redirects.html">Cross Host Redirects</a>
 
570
        
 
571
      </small>
 
572
          
 
573
        
 
574
      
 
575
    </div>
 
576
  
 
577
    
 
578
    
 
579
    
 
580
    
 
581
        
 
582
        
 
583
        
 
584
        
 
585
        
 
586
                   
 
587
        
 
588
    <div>
 
589
      <small>
 
590
        
 
591
        
 
592
                <a href="logging.html">Logging Guide</a>
 
593
        
 
594
      </small>
 
595
          
 
596
        
 
597
      
 
598
    </div>
 
599
  
 
600
    
 
601
    
 
602
    
 
603
    
 
604
        
 
605
        
 
606
        
 
607
        
 
608
        
 
609
                   
 
610
        
 
611
    <div>
 
612
      <small>
 
613
        
 
614
        
 
615
                <a href="methods.html">Methods</a>
 
616
        
 
617
      </small>
 
618
          
 
619
        
 
620
      
 
621
    </div>
 
622
  
 
623
    
 
624
    
 
625
    
 
626
    
 
627
        
 
628
        
 
629
        
 
630
        
 
631
        
 
632
                   
 
633
        
 
634
    <div>
 
635
      <small>
 
636
        
 
637
        
 
638
                <a href="http://cvs.apache.org/viewcvs.cgi/jakarta-commons/httpclient/src/examples/?only_with_tag=HTTPCLIENT_2_0_BRANCH" class="externalLink" title="External Link">Sample Code</a>
 
639
        
 
640
      </small>
 
641
          
 
642
        
 
643
      
 
644
    </div>
 
645
  
 
646
    
 
647
    
 
648
    
 
649
    
 
650
        
 
651
        
 
652
        
 
653
        
 
654
        
 
655
                   
 
656
        
 
657
    <div>
 
658
      <small>
 
659
        
 
660
        
 
661
                <a href="sslguide.html">SSL Guide</a>
 
662
        
 
663
      </small>
 
664
          
 
665
        
 
666
      
 
667
    </div>
 
668
  
 
669
    
 
670
    
 
671
    
 
672
    
 
673
        
 
674
        
 
675
        
 
676
        
 
677
        
 
678
                   
 
679
        
 
680
    <div>
 
681
      <small>
 
682
        
 
683
        
 
684
                <a href="threading.html">Threading</a>
 
685
        
 
686
      </small>
 
687
          
 
688
        
 
689
      
 
690
    </div>
 
691
  
 
692
    
 
693
    
 
694
    
 
695
    
 
696
        
 
697
        
 
698
        
 
699
        
 
700
        
 
701
                   
 
702
        
 
703
    <div>
 
704
      <small>
 
705
        
 
706
        
 
707
                <a href="troubleshooting.html">Trouble Shooting</a>
 
708
        
 
709
      </small>
 
710
          
 
711
        
 
712
      
 
713
    </div>
 
714
  
 
715
    
 
716
    
 
717
    
 
718
    
 
719
        
 
720
        
 
721
        
 
722
        
 
723
        
 
724
                   
 
725
        
 
726
    <div>
 
727
      <small>
 
728
        
 
729
        
 
730
                <a href="tutorial.html">Tutorial</a>
 
731
        
 
732
      </small>
 
733
          
 
734
        
 
735
      
 
736
    </div>
 
737
  
 
738
      
 
739
    </div>
 
740
  
 
741
    
 
742
    
 
743
    
 
744
    
 
745
        
 
746
        
 
747
        
 
748
        
 
749
        
 
750
                
 
751
          
 
752
                
 
753
                
 
754
        
 
755
                   
 
756
        
 
757
    <div>
 
758
      <small>
 
759
        
 
760
        
 
761
                <a href="developerguide.html">Developer Guide</a>
 
762
        
 
763
      </small>
 
764
          
 
765
        
 
766
    
 
767
    
 
768
    
 
769
    
 
770
        
 
771
        
 
772
        
 
773
        
 
774
        
 
775
                   
 
776
        
 
777
    <div>
 
778
      <small>
 
779
        
 
780
        
 
781
                <a href="releases.html">Release Process</a>
 
782
        
 
783
      </small>
 
784
          
 
785
        
 
786
      
 
787
    </div>
 
788
  
 
789
    
 
790
    
 
791
    
 
792
    
 
793
        
 
794
        
 
795
        
 
796
        
 
797
        
 
798
                   
 
799
        
 
800
    <div>
 
801
      <small>
 
802
        
 
803
        
 
804
                <a href="testwebapp.html">Webapp Test Guide</a>
 
805
        
 
806
      </small>
 
807
          
 
808
        
 
809
      
 
810
    </div>
 
811
  
 
812
      
 
813
    </div>
 
814
  
 
815
    </div>
 
816
  
 
817
                                
 
818
    <div>
 
819
      <strong>Project Documentation</strong>
 
820
      
 
821
    
 
822
    
 
823
    
 
824
    
 
825
        
 
826
        
 
827
        
 
828
        
 
829
        
 
830
                   
 
831
        
 
832
    <div>
 
833
      <small>
 
834
        
 
835
        
 
836
                <a href="index.html">About HttpClient</a>
 
837
        
 
838
      </small>
 
839
          
 
840
        
 
841
      
 
842
    </div>
 
843
  
 
844
    
 
845
    
 
846
    
 
847
    
 
848
        
 
849
        
 
850
        
 
851
        
 
852
        
 
853
                
 
854
                
 
855
          
 
856
                
 
857
        
 
858
                   
 
859
        
 
860
    <div>
 
861
      <small>
 
862
        
 
863
        
 
864
                <a href="project-info.html">Project Info</a>
 
865
        
 
866
      </small>
 
867
          
 
868
    </div>
 
869
  
 
870
    
 
871
    
 
872
    
 
873
    
 
874
        
 
875
        
 
876
        
 
877
        
 
878
        
 
879
                
 
880
                
 
881
          
 
882
                
 
883
        
 
884
                   
 
885
        
 
886
    <div>
 
887
      <small>
 
888
        
 
889
        
 
890
                <a href="maven-reports.html">Project Reports</a>
 
891
        
 
892
      </small>
 
893
          
 
894
    </div>
 
895
  
 
896
    
 
897
    
 
898
    
 
899
    
 
900
        
 
901
        
 
902
        
 
903
        
 
904
        
 
905
                   
 
906
        
 
907
    <div>
 
908
      <small>
 
909
        
 
910
        
 
911
                <a href="http://maven.apache.org/development-process.html" class="externalLink" title="External Link">Development Process</a>
 
912
        
 
913
      </small>
 
914
          
 
915
        
 
916
      
 
917
    </div>
 
918
  
 
919
    </div>
 
920
  
 
921
                
 
922
    <div>
 
923
      <strong>General Information</strong>
 
924
      
 
925
    
 
926
    
 
927
    
 
928
    
 
929
        
 
930
        
 
931
        
 
932
        
 
933
        
 
934
                   
 
935
        
 
936
    <div>
 
937
      <small>
 
938
        
 
939
        
 
940
                <a href="http://jakarta.apache.org/commons/charter.html" class="externalLink" title="External Link">Charter</a>
 
941
        
 
942
      </small>
 
943
          
 
944
        
 
945
      
 
946
    </div>
 
947
  
 
948
    
 
949
    
 
950
    
 
951
    
 
952
        
 
953
        
 
954
        
 
955
        
 
956
        
 
957
                   
 
958
        
 
959
    <div>
 
960
      <small>
 
961
        
 
962
        
 
963
                <a href="http://jakarta.apache.org/commons/volunteering.html" class="externalLink" title="External Link">Volunteering</a>
 
964
        
 
965
      </small>
 
966
          
 
967
        
 
968
      
 
969
    </div>
 
970
  
 
971
    
 
972
    
 
973
    
 
974
    
 
975
        
 
976
        
 
977
        
 
978
        
 
979
        
 
980
                   
 
981
        
 
982
    <div>
 
983
      <small>
 
984
        
 
985
        
 
986
                <a href="http://jakarta.apache.org/commons/patches.html" class="externalLink" title="External Link">Contributing Patches</a>
 
987
        
 
988
      </small>
 
989
          
 
990
        
 
991
      
 
992
    </div>
 
993
  
 
994
    
 
995
    
 
996
    
 
997
    
 
998
        
 
999
        
 
1000
        
 
1001
        
 
1002
        
 
1003
                   
 
1004
        
 
1005
    <div>
 
1006
      <small>
 
1007
        
 
1008
        
 
1009
                <a href="http://jakarta.apache.org/commons/releases/index.html" class="externalLink" title="External Link">Releasing Components</a>
 
1010
        
 
1011
      </small>
 
1012
          
 
1013
        
 
1014
      
 
1015
    </div>
 
1016
  
 
1017
    </div>
 
1018
  
 
1019
    <div>
 
1020
      <strong>Jakarta Community</strong>
 
1021
      
 
1022
    
 
1023
    
 
1024
    
 
1025
    
 
1026
        
 
1027
        
 
1028
        
 
1029
        
 
1030
        
 
1031
                   
 
1032
        
 
1033
    <div>
 
1034
      <small>
 
1035
        
 
1036
        
 
1037
                <a href="http://jakarta.apache.org/site/getinvolved.html" class="externalLink" title="External Link">Get Involved</a>
 
1038
        
 
1039
      </small>
 
1040
          
 
1041
        
 
1042
      
 
1043
    </div>
 
1044
  
 
1045
    
 
1046
    
 
1047
    
 
1048
    
 
1049
        
 
1050
        
 
1051
        
 
1052
        
 
1053
        
 
1054
                   
 
1055
        
 
1056
    <div>
 
1057
      <small>
 
1058
        
 
1059
        
 
1060
                <a href="http://jakarta.apache.org/site/mail.html" class="externalLink" title="External Link">Mailing Lists</a>
 
1061
        
 
1062
      </small>
 
1063
          
 
1064
        
 
1065
      
 
1066
    </div>
 
1067
  
 
1068
    
 
1069
    
 
1070
    
 
1071
    
 
1072
        
 
1073
        
 
1074
        
 
1075
        
 
1076
        
 
1077
                   
 
1078
        
 
1079
    <div>
 
1080
      <small>
 
1081
        
 
1082
        
 
1083
                <a href="http://jakarta.apache.org/site/cvsindex.html" class="externalLink" title="External Link">Access�CVS�Repositories</a>
 
1084
        
 
1085
      </small>
 
1086
          
 
1087
        
 
1088
      
 
1089
    </div>
 
1090
  
 
1091
    </div>
 
1092
  
 
1093
    <div>
 
1094
      <strong>Commons�Resources�(Unofficial)</strong>
 
1095
      
 
1096
    
 
1097
    
 
1098
    
 
1099
    
 
1100
        
 
1101
        
 
1102
        
 
1103
        
 
1104
        
 
1105
                   
 
1106
        
 
1107
    <div>
 
1108
      <small>
 
1109
        
 
1110
        
 
1111
                <a href="http://nagoya.apache.org/wiki/apachewiki.cgi?JakartaCommonsProjectPages" class="externalLink" title="External Link">Wiki</a>
 
1112
        
 
1113
      </small>
 
1114
          
 
1115
        
 
1116
      
 
1117
    </div>
 
1118
  
 
1119
    
 
1120
    
 
1121
    
 
1122
    
 
1123
        
 
1124
        
 
1125
        
 
1126
        
 
1127
        
 
1128
                   
 
1129
        
 
1130
    <div>
 
1131
      <small>
 
1132
        
 
1133
        
 
1134
                <a href="http://jakarta.terra-intl.com/commons/" class="externalLink" title="External Link">Japanese�Translation</a>
 
1135
        
 
1136
      </small>
 
1137
          
 
1138
        
 
1139
      
 
1140
    </div>
 
1141
  
 
1142
    
 
1143
    
 
1144
    
 
1145
    
 
1146
        
 
1147
        
 
1148
        
 
1149
        
 
1150
        
 
1151
                   
 
1152
        
 
1153
    <div>
 
1154
      <small>
 
1155
        
 
1156
        
 
1157
                <a href="http://jakarta.apache-korea.org/commons/" class="externalLink" title="External Link">Korean�Translation</a>
 
1158
        
 
1159
      </small>
 
1160
          
 
1161
        
 
1162
      
 
1163
    </div>
 
1164
  
 
1165
    </div>
 
1166
  
 
1167
    <div>
 
1168
      <strong>Related</strong>
 
1169
      
 
1170
    
 
1171
    
 
1172
    
 
1173
    
 
1174
        
 
1175
        
 
1176
        
 
1177
        
 
1178
        
 
1179
                   
 
1180
        
 
1181
    <div>
 
1182
      <small>
 
1183
        
 
1184
        
 
1185
                <a href="http://commons.apache.org/" class="externalLink" title="External Link">Apache Commons</a>
 
1186
        
 
1187
      </small>
 
1188
          
 
1189
        
 
1190
      
 
1191
    </div>
 
1192
  
 
1193
    
 
1194
    
 
1195
    
 
1196
    
 
1197
        
 
1198
        
 
1199
        
 
1200
        
 
1201
        
 
1202
                   
 
1203
        
 
1204
    <div>
 
1205
      <small>
 
1206
        
 
1207
        
 
1208
                <a href="http://db.apache.org/commons/" class="externalLink" title="External Link">DB Commons</a>
 
1209
        
 
1210
      </small>
 
1211
          
 
1212
        
 
1213
      
 
1214
    </div>
 
1215
  
 
1216
    
 
1217
    
 
1218
    
 
1219
    
 
1220
        
 
1221
        
 
1222
        
 
1223
        
 
1224
        
 
1225
                   
 
1226
        
 
1227
    <div>
 
1228
      <small>
 
1229
        
 
1230
        
 
1231
                <a href="http://xml.apache.org/commons/" class="externalLink" title="External Link">XML Commons</a>
 
1232
        
 
1233
      </small>
 
1234
          
 
1235
        
 
1236
      
 
1237
    </div>
 
1238
  
 
1239
    </div>
 
1240
  
 
1241
 
 
1242
                
 
1243
                
 
1244
 
 
1245
                
 
1246
                
 
1247
                
 
1248
                
 
1249
                        <div style="margin-top: 20px; width: 100%; text-align: center;">
 
1250
                                <a href="http://maven.apache.org/" title="Built by Maven"><img style="border: 1px solid black" alt="Built by Maven" src="./images/logos/maven-button-1.png"></img></a>
 
1251
                        </div>
 
1252
                
 
1253
              
 
1254
                
 
1255
              </div>
 
1256
            </td>
 
1257
            <td rowspan="2">
 
1258
              <div id="bodycol">
 
1259
                
 
1260
                <div class="app">
 
1261
                  
 
1262
                  
 
1263
    <div class="h3">
 
1264
      
 
1265
      
 
1266
        <h3>
 
1267
          <a name="Introduction">Introduction</a>
 
1268
        </h3>
 
1269
      
 
1270
      <p>HttpClient supports automatic management of cookies, including
 
1271
      allowing the server to set cookies and automatically return them to the
 
1272
      server when required.  It is also possible to manually set cookies to be
 
1273
      sent to the server.</p><p>Unfortunately, there are several at times conflicting  standards for 
 
1274
      handling Cookies: the Netscape Cookie draft, RFC2109, RFC2965 and a large
 
1275
      number of vendor specific implementations that are compliant with neither 
 
1276
      specification. To deal with this, HttpClient provides policy driven cookie 
 
1277
      management. This guide will explain how to use the different cookie 
 
1278
      specifications and identify some of the common problems people have when 
 
1279
      using Cookies and HttpClient.</p>
 
1280
    </div>
 
1281
  
 
1282
    <div class="h3">
 
1283
      
 
1284
      
 
1285
        <h3>
 
1286
          <a name="Available Specifications">Available Specifications</a>
 
1287
        </h3>
 
1288
      
 
1289
      <p>The following cookie specifications are supported by HttpClient.</p>
 
1290
    <div class="h4">
 
1291
      
 
1292
      
 
1293
        <h4>
 
1294
          <a name="Netscape Draft">Netscape Draft</a>
 
1295
        </h4>
 
1296
      
 
1297
      <p>The Netscape draft is the original cookie specification which formed
 
1298
        the basis for RFC2109.  Despite this it has some significant
 
1299
        differences with RFC2109 and thus may be required for compatibility
 
1300
        with some servers.</p><p>The Netscape cookie draft is available at 
 
1301
    <a href="http://wp.netscape.com/newsref/std/cookie_spec.html">http://wp.netscape.com/newsref/std/cookie_spec.html</a>
 
1302
  
 
1303
        </p>
 
1304
    </div>
 
1305
  
 
1306
    <div class="h4">
 
1307
      
 
1308
      
 
1309
        <h4>
 
1310
          <a name="RFC2109">RFC2109</a>
 
1311
        </h4>
 
1312
      
 
1313
      <p>RFC2109 is the first official cookie specification released by the W3C.
 
1314
        Theoretically, all servers that handle version 1 cookies should use this
 
1315
        specification and as such this specification is used by default within
 
1316
        HttpClient.</p><p>Unfortunately, many servers either incorrectly implement this
 
1317
        standard or are still using the Netscape draft so occasionally this
 
1318
        specification is too strict.  If this is the case, you should switch to
 
1319
        the compatibility specification as described below.</p><p>RFC2109 is available at
 
1320
        
 
1321
    <a href="http://www.w3.org/Protocols/rfc2109/rfc2109.txt">http://www.w3.org/Protocols/rfc2109/rfc2109.txt</a>
 
1322
  
 
1323
        </p>
 
1324
    </div>
 
1325
  
 
1326
    <div class="h4">
 
1327
      
 
1328
      
 
1329
        <h4>
 
1330
          <a name="Compatibility">Compatibility</a>
 
1331
        </h4>
 
1332
      
 
1333
      <p>The compatibility specification is designed to be compatible with as
 
1334
        many different servers as possible even if they are not completely
 
1335
        standards compliant. If you are encountering problems with parsing
 
1336
        cookies, you should probably try using this specification.</p>
 
1337
    </div>
 
1338
  
 
1339
    </div>
 
1340
  
 
1341
    <div class="h3">
 
1342
      
 
1343
      
 
1344
        <h3>
 
1345
          <a name="Unsupported Specifications">Unsupported Specifications</a>
 
1346
        </h3>
 
1347
      
 
1348
      <p>The following cookie specifications are not presently supported by HttpClient.</p>
 
1349
    <div class="h4">
 
1350
      
 
1351
      
 
1352
        <h4>
 
1353
          <a name="RFC2965">RFC2965</a>
 
1354
        </h4>
 
1355
      
 
1356
      <p>RFC2965 defines cookie version 2 and attempts to address the shortcomings 
 
1357
        of the RFC2109 regarding cookie version 1. RFC2965 is intended to eventually 
 
1358
        supersede RFC2109.</p><p>Currently HttpClient does not implement this specification. Support for
 
1359
           version 2 cookies will be added in the future</p><p>RFC2965 is available at
 
1360
        
 
1361
    <a href="http://www.zvon.org/tmRFC/RFC2965/Output/">http://www.zvon.org/tmRFC/RFC2965/Output/</a>
 
1362
  
 
1363
        </p>
 
1364
    </div>
 
1365
  
 
1366
    </div>
 
1367
  
 
1368
    <div class="h3">
 
1369
      
 
1370
      
 
1371
        <h3>
 
1372
          <a name="Specifying the Specification">Specifying the Specification</a>
 
1373
        </h3>
 
1374
      
 
1375
      <p>There is two ways to specify which cookie specification should be
 
1376
      used, either for each HttpState instance, or by setting the default for
 
1377
      newly created HttpState instances.</p>
 
1378
    <div class="h4">
 
1379
      
 
1380
      
 
1381
        <h4>
 
1382
          <a name="Per HttpState">Per HttpState</a>
 
1383
        </h4>
 
1384
      
 
1385
      <p>In most cases, the best way to set which cookie specification to use
 
1386
        is using the <code>setCookiePolicy(int policy)</code> method on
 
1387
        <code>HttpState</code>.  Any HttpClient using that HttpState will then
 
1388
        use the specified cookie policy.  The value of <code>policy</code>
 
1389
        should be one of:</p><ul>
 
1390
          <li><code>CookiePolicy.COMPATIBILITY</code></li>
 
1391
          <li><code>CookiePolicy.NETSCAPE_DRAFT</code></li>
 
1392
          <li><code>CookiePolicy.RFC2109</code></li>
 
1393
        </ul>
 
1394
    <div id="source">
 
1395
      <pre>
 
1396
        HttpClient client = new HttpClient();
 
1397
        client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
 
1398
        </pre>
 
1399
    </div>
 
1400
  
 
1401
    </div>
 
1402
  
 
1403
    <div class="h4">
 
1404
      
 
1405
      
 
1406
        <h4>
 
1407
          <a name="Default">Default</a>
 
1408
        </h4>
 
1409
      
 
1410
      <p>The default cookie specification can be set by setting the system
 
1411
        property <code>apache.commons.httpclient.cookiespec</code> to one
 
1412
        of:</p><ul>
 
1413
          <li><code>"COMPATIBILITY"</code></li>
 
1414
          <li><code>"NETSCAPE_DRAFT"</code></li>
 
1415
          <li><code>"RFC2109"</code></li>
 
1416
        </ul><p>This setting will be used by any newly created HttpState objects,
 
1417
        however existing HttpState instances will not be affected.</p>
 
1418
    <div id="source">
 
1419
      <pre>
 
1420
        System.setProperty("apache.commons.httpclient.cookiespec", "COMPATIBILITY");
 
1421
        </pre>
 
1422
    </div>
 
1423
  
 
1424
    </div>
 
1425
  
 
1426
    </div>
 
1427
  
 
1428
    <div class="h3">
 
1429
      
 
1430
      
 
1431
        <h3>
 
1432
          <a name="Common Problems">Common Problems</a>
 
1433
        </h3>
 
1434
      
 
1435
      <p>The most common problems encountered with parsing cookies is due to
 
1436
      non-compliant servers.  In these cases, switching to the compatibility
 
1437
      cookie specification usually solves the problem.</p>
 
1438
    </div>
 
1439
  
 
1440
    <div class="h3">
 
1441
      
 
1442
      
 
1443
        <h3>
 
1444
          <a name="Encoding Issues">Encoding Issues</a>
 
1445
        </h3>
 
1446
      
 
1447
      <p>Since cookies are transfered as HTTP Headers they are confined to
 
1448
      the <tt>US-ASCII</tt> character set. Other characters will be lost or
 
1449
      mangeled. Cookies are typically set and read by the same server, so
 
1450
      a custom scheme for escaping non-ASCII characters can be used, for
 
1451
      instance the well-established URL encoding scheme. If cookies are
 
1452
      used to transfer data between server and client both parties must
 
1453
      agree on the escaping scheme used in a custom way. The HttpClient
 
1454
      cookie implementation provides no special means to handle non-ASCII
 
1455
      characters nor does it issue warnings.</p>
 
1456
    </div>
 
1457
  
 
1458
                  
 
1459
                  
 
1460
                  
 
1461
                  
 
1462
                  
 
1463
                </div>
 
1464
              </div>
 
1465
            </td>
 
1466
          </tr>
 
1467
        </table>
 
1468
        <div id="footer">
 
1469
          <table border="0" style="width:100%" cellpadding="4" cellspacing="0">
 
1470
            
 
1471
            <tr>
 
1472
              <td>
 
1473
                
 
1474
                  
 
1475
                    
 
1476
                    
 
1477
                      � 2001-2004, Apache Software Foundation
 
1478
                    
 
1479
                  
 
1480
                  
 
1481
                
 
1482
 
 
1483
                
 
1484
              </td>
 
1485
              
 
1486
            </tr>
 
1487
          </table>
 
1488
        </div>
 
1489
      </body>
 
1490
    </html>
 
1491