lilinkevin / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

when multiple session id is returned, sessionFilter record the first session instead of the last session #388

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. our API return the JSESSIONID twice in the response as below:

HTTP/1.1 204 No Content
Server: Apache-Coyote/1.1
X-Powered-By: Servlet/3.0; JBossAS-6
Set-Cookie: JSESSIONID=62D1D59D748A8F4634D6F791881626CC.q2jb1vip1; Expires=Tue, 
03-Mar-2015 17:25:43 GMT; Path=/
x-wily-info: Clear guid=E075105A0A27025001E014CEAA23271F
x-wily-servlet: Encrypt1 
Xnksvd+miNh9ArlLEFWXNlbi1pnj4cFAxUsse4V8i7u7o23Mnd31l7uwqFABsB1cfashWsgA2RkHs+IT
ldYaAANknN0YfZgljUDVw5QcoGmnmz91NZRnHjJgseNTyTFB0ggXRjlWZggjV/rvLHN1dJUraJk1bs78
Ov3kFc1HTFI=
Set-Cookie: JSESSIONID=538C8DE5DB757636E028BABAB3847A60.q2jb1vip1; Expires=Tue, 
03-Mar-2015 17:25:43 GMT; Path=/
Date: Tue, 03 Mar 2015 16:25:43 GMT

2.when use sessionFilter to record the session id returned from the server, it 
always record the first one. in this example 
JSESSIONID=62D1D59D748A8F4634D6F791881626CC.q2jb1vip1

3.it should instead record the last oen, in this example will be
JSESSIONID=538C8DE5DB757636E028BABAB3847A60.q2jb1vip1

What is the expected output? What do you see instead?
when multiple session id is returned, should always use the latest one, this is 
how browsers behavior as well. But instead, sessionFilter seems record the 
first one.

What version of the product are you using? On what operating system?
using rest-assured-2.3.3.jar, tested on windows.

Please provide any additional information below.

Original issue reported on code.google.com by allenhup...@gmail.com on 3 Mar 2015 at 4:35

GoogleCodeExporter commented 9 years ago
Is it the same with headers and all other values passed in the response? In 
that case I suppose we should change this for everything. Right now the first 
value is always returned.

Original comment by johan.ha...@gmail.com on 16 Mar 2015 at 10:58