I have an outgoing http endpoint in Mule 3.2.1. As a response to my initial request the http server responds with the Set-Cookie header and Mule dutifully stores this cookie and uses it on the following requests.
My problem comes when the session associated with this cookie times out.
Then, the server replies something like “error, session timed out” on requests.
My clients then receive an error because of this.
My question is, do you see a a way to work around this issue, or make Mule stop sending the Cookie: header? I’m thinking I could maybe add something to the outgoing http request to make it not use cookies afterall. I’m able to add header to the request before it is sent, but I’ve not found a way in the documentation to remove headers that Mule adds automatically.
If there is a way I can make Mule repeat the http request when the body of the response contains “session timed out”, that would be smashing 🙂
Some details:
In previous versions of Mule there was a “enableCookies” property you could set. In this version of Mule that property causes an error when used. The xml parser reads the mule config xml on startup and bails when the property is set, even though the property is still mentioned in the code.
Also, it seems that Mule-BUG 5937 causes cookies expire date to be ignored, and that Mule-bug 5195 ignores the “enableCookies” property. It seems that I must patch and fix at least three Mule-issues to make this work. I’m not convinced it would work even after those changes and I’m strapped for time. Switching to an older Mule-version would require a lot of changes, I fear, as I use some new 3.2-constructs.
Of course, another way to fix the problem is to make the http server stop sending the “Set-Cookie:” header, but it’s owned by another company and not easy to change quickly.
Replying to my own question here..
This is one way to solve it, override the cookies Mule is using.
I set this on the outbound http endpoint:
This overrides the SMSSESSION cookie, which was causing trouble in my case.