Forum Discussion

NewBear1's avatar
New Contributor
7 years ago

SoapUI Cookie Sample Code not working

I have a test case where I run a REST request and get back the following in the header:

Header: Set-Cookie  Value: jsessionid=20180111


In a subsequent Groovy Script step, I have the following code:

def myCookieStore = HttpClientSupport.getHttpClient().getCookieStore()
def myCookies = myCookieStore.getCookies() myCookies.size()


It returns a size of 0.  


Why isn't the jsessionid cookie showing up in the Cookie store?


I have seen several posts here and elsewhere that list this as code to get returned Cookie values.



My ultimate goal is to send this Cookie with a subsequent response, but I can't seem to get to the point where I even see the cookie.


I have tried this with the test case setting "Maintain HTTP Session" both checked and unchecked.  It doesn't seem to make a difference.