Yea, i just figured that out too. I was looking for a checkbox called "cookie"-something.
I guess if i use cookies to identify sessions this option will maintain them. (In my case I do, so this works for me)
Just to clarify; does "Maintain HTTP session" do anything else than preserving cookies?
Or could the name of this option really be "Maintain HTTP cookies"?
And one more note. Even though i enable this option i still cannot iterate the cookies using the above code. Since the time will come when i will need to get cookie-values i dug into this problem. It seems that while the "Maintain HTTP session" DO keep track of the cookies, it doesn't do it using the cookieStore returned by getHttpClient().getCookieStore().
The following code works for me in the end. Do note that this still requires the "Maintain HTTP session" option to be on.
// Define variable to hold sessionCookie value if we find it.
def sessionCookie;
final httpStatePropertyName = com.eviware.soapui.model.testsuite.TestRunContext.HTTP_STATE_PROPERTY;
final httpContext = context.getProperty(httpStatePropertyName);
assert httpContext;
// Get cookie store
final cookieStore = httpContext.getAttribute("http.cookie-store");
log.info("cookieStore: " + cookieStore);
// Get cookies from store
def cookies = cookieStore.getCookies();
cookies.each {
log.info(it.name);
if (it.name == "ASP.NET_SessionId"){
sessionCookie = it.value;
}
}
assert sessionCookie;
log.info(sessionCookie)