Unable to get Cookie info in response headers

We are implementing REST web services in IS 9.5. We have created REST service wherein we are using pub.client.http service to make a call to backend system which is JBOSS server. The JBOSS server will return few fields in response headers, “Cookie” is one among them. We are able to receive all the header fields returned by JBOSS server in http “header/lines” documnet in flow service except the “Cookie” field. We can able to see the Cookie value in server log but not in http service “header/lines” document in flow service. Please suggest on how to get cookie value returned from JBOSS Server in the flow service.

Thanks in Advance.
Jacob B

You are acting as a client, so in the response, you will not get Cookie header field, instead, you should get Set-Cookie header field. And it should be under header/lines.

BTW, Set-Cookie won’t show up every time you call.
If the client (your IS) is presenting a valid cookie in the request, the corresponding session will be used, so you will see Set-Cookie only when a new session is create after the old one expires.

Hi Tong,

  1. I am not seeing “Set-Cookie” field under header/lines (even thought it is passed by backend in response headers)

  2. In the request we are not passing cookie value. We are passing only parameters (like username and password). The backend system is returning Cookie as “Set-Cookie” field in response headers. But we are not seeing that under header/lines(in flow service).

Can you suggest on this please ?

Jacob B

Which version of WM are you running?
I tested in 8.0 and 9.8, both will show the Set-Cookie under header/lines.
Again, it normally will only show up when a new session is created. The 2nd time you run it, since the cookie is already set, it won’t show.

Tong wang,

As per the initial thread start indicates they are on running on IS 9.5.


Then it should be there.
You can set: newSession parameter to yes, so it will open a new session every time, and the Set-Cookie will be there too.

Hi tong

  1. We are not setting the cookie in IS instead we are passing the cooking returned by backend.
  2. We have tried by setting new session as yes but we could not see the cookie in header. As per my understanding setting the new session as yes will return new cookie when we are setting the cookie in webMethods.

looked again at your IS server log lines:
the cookie line was shown with status 302
302 is redirecting.
your Set-Cookie may be in the 302, but not necessarily in the 200, depends on how redirect is done.
I guess that’s why you are not seeing the Set-Cookie in your response header.

Hi Tong,
Yes there are redirects. As per my understanding, webMethods is accepting/acknowledging the cookie. So only one cookie is used in redirects. But we should be able to see the cookie in headers as per documentation which is not happening.

Hi Tong,

The issue is resolved. We need to provide clear IP and Port details in the pub.http service as below in order to see the cookie in response header.


Thanks for your reply.