Closed GoogleCodeExporter closed 9 years ago
Thanks for reporting!
Original comment by johan.ha...@gmail.com
on 26 Apr 2013 at 11:16
Is there a workaround for this defect? I would love to have this resolved...we
have a sessionid which changes after login, and I don't have a way to access
the new sessionid for subsequent calls.
Original comment by lgregory...@gmail.com
on 27 Aug 2013 at 4:30
Not yet. I suspect that the sessionid is lost somewhere in the FormAuthFilter,
probably on line 58. The session id (and possibly other headers) should be
copied to the Response object. It would be cool if you could help out with this.
Original comment by johan.ha...@gmail.com
on 28 Aug 2013 at 5:44
You do not know the code in detail, but the problem could be in the concept.
The second response doesn't contain 'Set-Cookie' header, so the session ID has
to be remembered from the first response.
I've made an workaround, simplified code of it is attached.
Usage :
MySession ses = new MySession();
ses.login("username", "password")
ses.given()
.with().pathParam(...)
.expect().statusCode(HttpStatus.SC_OK)
.when().get(...);
ses.given()...;
Original comment by vkra...@gmail.com
on 28 Aug 2013 at 6:12
Attachments:
> You do not know the code in detail,
^^^^^ This should be : "I do not know"
My mistake, sorry.
Original comment by vkra...@gmail.com
on 28 Aug 2013 at 7:09
No problem. Good that you found a work-around, I think it confirms my
suspicions. Thanks!
Original comment by johan.ha...@gmail.com
on 28 Aug 2013 at 9:54
I've now implemented better session support, you can now do:
SessionFilter sessionFilter = new SessionFilter();
given().
auth().form("John", "Doe").
filter(sessionFilter).
expect().
statusCode(200).
when().
get("/formAuth");
given().
filter(sessionFilter). // Reuse sessionId from previous filter
expect().
statusCode(200).
when().
get("/formAuth");
String sessionId = sessionFilter.getSessionId();
Please try it out by depending on version 1.8.2-SNAPSHOT after having added the
following repo:
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots />
</repository>
</repositories>
Original comment by johan.ha...@gmail.com
on 22 Nov 2013 at 4:10
Original issue reported on code.google.com by
vkra...@gmail.com
on 24 Apr 2013 at 7:21