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