• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6cookies
7shared cookies
8</keywords>
9</info>
10
11# Server-side
12<reply>
13<data1>
14HTTP/1.1 200 OK
15Date: Thu, 09 Nov 2010 14:49:00 GMT
16Server: test-server/fake
17Content-Type: text/html
18Set-Cookie: test1=one; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
19Set-Cookie: test2=two; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
20Set-Cookie: test3=three; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
21Content-Length: 29
22
23run 1: set cookie 1, 2 and 3
24</data1>
25<data2>
26HTTP/1.1 200 OK
27Date: Thu, 09 Nov 2010 14:49:01 GMT
28Server: test-server/fake
29Content-Type: text/html
30Set-Cookie: test4=four; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
31Set-Cookie: test5=five; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
32Content-Length: 26
33
34run 2: set cookie 4 and 5
35</data2>
36<data3>
37HTTP/1.1 200 OK
38Date: Thu, 09 Nov 2010 14:49:02 GMT
39Server: test-server/fake
40Content-Type: text/html
41Funny-head: yesyes
42Set-Cookie: test4=overwritten4; domain=host.foo.com; expires=Sat May 5 GMT 11:56:27 2035
43Set-Cookie: test1=overwritten1; domain=foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
44Set-Cookie: test6=six; domain=.www.host.foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
45Set-Cookie: test6=six_more; expires=Thu Mar 3 GMT 11:56:27 2033
46Content-Type: text/html
47Content-Length: 73
48
49run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch
50</data3>
51</reply>
52
53# Client-side
54<client>
55<server>
56http
57</server>
58# don't run this with the threaded-resolver since the events might trigger in
59# a different order!
60<features>
61!threaded-resolver
62</features>
63<name>
64HTTP with shared cookie list (and dns cache)
65</name>
66# Explicitly set the time zone to a known good one, in case the user is
67# using one of the 'right' zones that take into account leap seconds
68# which causes the cookie expiry times to be different.
69<setenv>
70TZ=GMT
71</setenv>
72<tool>
73lib506
74</tool>
75<command>
76http://%HOSTIP:%HTTPPORT/506
77</command>
78</client>
79
80# Verify data after the test has been "shot"
81<verify>
82<stdout>
83GLOBAL_INIT
84SHARE_INIT
85CURLSHOPT_LOCKFUNC
86CURLSHOPT_UNLOCKFUNC
87CURLSHOPT_USERDATA
88CURL_LOCK_DATA_COOKIE
89CURL_LOCK_DATA_DNS
90CURLOPT_SHARE
91lock:   share  [Pigs in space]: 0
92unlock: share  [Pigs in space]: 1
93CURLOPT_COOKIELIST injected_and_clobbered
94lock:   cookie [Pigs in space]: 2
95unlock: cookie [Pigs in space]: 3
96CURLOPT_COOKIELIST ALL
97lock:   cookie [Pigs in space]: 4
98unlock: cookie [Pigs in space]: 5
99CURLOPT_COOKIELIST session
100lock:   cookie [Pigs in space]: 6
101unlock: cookie [Pigs in space]: 7
102CURLOPT_COOKIELIST injected
103lock:   cookie [Pigs in space]: 8
104unlock: cookie [Pigs in space]: 9
105CURLOPT_COOKIELIST SESS
106lock:   cookie [Pigs in space]: 10
107unlock: cookie [Pigs in space]: 11
108CLEANUP
109lock:   cookie [Pigs in space]: 12
110unlock: cookie [Pigs in space]: 13
111lock:   share  [Pigs in space]: 14
112unlock: share  [Pigs in space]: 15
113*** run 1
114CURLOPT_SHARE
115lock:   share  [Pigs in space]: 16
116unlock: share  [Pigs in space]: 17
117PERFORM
118lock:   cookie [Pigs in space]: 18
119unlock: cookie [Pigs in space]: 19
120lock:   dns    [Pigs in space]: 20
121unlock: dns    [Pigs in space]: 21
122lock:   dns    [Pigs in space]: 22
123unlock: dns    [Pigs in space]: 23
124lock:   cookie [Pigs in space]: 24
125unlock: cookie [Pigs in space]: 25
126lock:   cookie [Pigs in space]: 26
127unlock: cookie [Pigs in space]: 27
128lock:   cookie [Pigs in space]: 28
129unlock: cookie [Pigs in space]: 29
130lock:   cookie [Pigs in space]: 30
131unlock: cookie [Pigs in space]: 31
132run 1: set cookie 1, 2 and 3
133lock:   dns    [Pigs in space]: 32
134unlock: dns    [Pigs in space]: 33
135lock:   dns    [Pigs in space]: 34
136unlock: dns    [Pigs in space]: 35
137CLEANUP
138lock:   cookie [Pigs in space]: 36
139unlock: cookie [Pigs in space]: 37
140lock:   share  [Pigs in space]: 38
141unlock: share  [Pigs in space]: 39
142*** run 2
143CURLOPT_SHARE
144lock:   share  [Pigs in space]: 40
145unlock: share  [Pigs in space]: 41
146PERFORM
147lock:   cookie [Pigs in space]: 42
148unlock: cookie [Pigs in space]: 43
149lock:   dns    [Pigs in space]: 44
150unlock: dns    [Pigs in space]: 45
151lock:   cookie [Pigs in space]: 46
152unlock: cookie [Pigs in space]: 47
153lock:   cookie [Pigs in space]: 48
154unlock: cookie [Pigs in space]: 49
155lock:   cookie [Pigs in space]: 50
156unlock: cookie [Pigs in space]: 51
157run 2: set cookie 4 and 5
158lock:   dns    [Pigs in space]: 52
159unlock: dns    [Pigs in space]: 53
160lock:   dns    [Pigs in space]: 54
161unlock: dns    [Pigs in space]: 55
162CLEANUP
163lock:   cookie [Pigs in space]: 56
164unlock: cookie [Pigs in space]: 57
165lock:   share  [Pigs in space]: 58
166unlock: share  [Pigs in space]: 59
167*** run 3
168CURLOPT_SHARE
169lock:   share  [Pigs in space]: 60
170unlock: share  [Pigs in space]: 61
171CURLOPT_COOKIEJAR
172CURLOPT_COOKIELIST FLUSH
173lock:   cookie [Pigs in space]: 62
174unlock: cookie [Pigs in space]: 63
175PERFORM
176lock:   dns    [Pigs in space]: 64
177unlock: dns    [Pigs in space]: 65
178lock:   cookie [Pigs in space]: 66
179unlock: cookie [Pigs in space]: 67
180lock:   cookie [Pigs in space]: 68
181unlock: cookie [Pigs in space]: 69
182lock:   cookie [Pigs in space]: 70
183unlock: cookie [Pigs in space]: 71
184lock:   cookie [Pigs in space]: 72
185unlock: cookie [Pigs in space]: 73
186lock:   cookie [Pigs in space]: 74
187unlock: cookie [Pigs in space]: 75
188run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch
189lock:   dns    [Pigs in space]: 76
190unlock: dns    [Pigs in space]: 77
191lock:   dns    [Pigs in space]: 78
192unlock: dns    [Pigs in space]: 79
193CLEANUP
194lock:   cookie [Pigs in space]: 80
195unlock: cookie [Pigs in space]: 81
196lock:   share  [Pigs in space]: 82
197unlock: share  [Pigs in space]: 83
198CURLOPT_SHARE
199lock:   share  [Pigs in space]: 84
200unlock: share  [Pigs in space]: 85
201CURLOPT_COOKIELIST ALL
202lock:   cookie [Pigs in space]: 86
203unlock: cookie [Pigs in space]: 87
204CURLOPT_COOKIEJAR
205CURLOPT_COOKIELIST RELOAD
206lock:   cookie [Pigs in space]: 88
207unlock: cookie [Pigs in space]: 89
208lock:   cookie [Pigs in space]: 90
209unlock: cookie [Pigs in space]: 91
210loaded cookies:
211-----------------
212  www.host.foo.com	FALSE	/	FALSE	1993463787	test6	six_more
213  .www.host.foo.com	TRUE	/	FALSE	1993463787	test6	six
214  .host.foo.com	TRUE	/	FALSE	1896263787	test5	five
215  .host.foo.com	TRUE	/	FALSE	2061978987	test4	overwritten4
216  .foo.com	TRUE	/	FALSE	1896263787	test3	three
217  .host.foo.com	TRUE	/	FALSE	1896263787	test2	two
218  .foo.com	TRUE	/	FALSE	1993463787	test1	overwritten1
219  .host.foo.com	TRUE	/	FALSE	1896263787	injected	yes
220-----------------
221try SHARE_CLEANUP...
222lock:   share  [Pigs in space]: 92
223unlock: share  [Pigs in space]: 93
224SHARE_CLEANUP failed, correct
225CLEANUP
226lock:   cookie [Pigs in space]: 94
227unlock: cookie [Pigs in space]: 95
228lock:   share  [Pigs in space]: 96
229unlock: share  [Pigs in space]: 97
230SHARE_CLEANUP
231lock:   share  [Pigs in space]: 98
232unlock: share  [Pigs in space]: 99
233GLOBAL_CLEANUP
234</stdout>
235<file name="log/jar506" mode="text">
236# Netscape HTTP Cookie File
237# https://curl.haxx.se/docs/http-cookies.html
238# This file was generated by libcurl! Edit at your own risk.
239
240www.host.foo.com	FALSE	/	FALSE	1993463787	test6	six_more
241.www.host.foo.com	TRUE	/	FALSE	1993463787	test6	six
242.host.foo.com	TRUE	/	FALSE	1896263787	test5	five
243.host.foo.com	TRUE	/	FALSE	2061978987	test4	overwritten4
244.foo.com	TRUE	/	FALSE	1896263787	test3	three
245.host.foo.com	TRUE	/	FALSE	1896263787	test2	two
246.foo.com	TRUE	/	FALSE	1993463787	test1	overwritten1
247.host.foo.com	TRUE	/	FALSE	1896263787	injected	yes
248</file>
249</verify>
250</testcase>
251