web stats
Multiple cookies in HTTP request - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2012, 03:50 PM
nelson.wells nelson.wells is offline
OBX.1 Kenobi
 
Join Date: Sep 2010
Posts: 26
nelson.wells is on a distinguished road
Default Multiple cookies in HTTP request

I have a channel that has 3 destinations, in the following order: "login", "parse_cookie", "call_webservice". Login is an HTTP connector that sends a POST request to a web service, and sends set-cookie header back. In parse_cookie, I do exactly that; I parse the header with the Javascript writer connector and then put the value of the cookie into the channelMap. Finally, in call_webservice (another HTTP connector), I call a web service with the "Cookie" header set to the cookie I parsed from the previous Javascript writer. However, using WireShark, I have verified that there are actually TWO Cookie headers being made in the request. The web service doesn't know what to do with it, so the service doesn't work.

Oddly, if I only send one message, the request processes fine because there is only one cookie being sent in the HTTP headers. However, when I send multiple messages, every message fails because of the multiple header cookie problem. Does anyone have any idea why this is happening and how to fix it?
Reply With Quote
  #2  
Old 05-10-2012, 03:54 PM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

What version are you on?

Also, when you say "send multiple messages", you mean that when you send one message through the channel it works fine, but when you send more than one message in a short time frame, it doesn't?

Last edited by narupley; 05-10-2012 at 04:05 PM.
Reply With Quote
  #3  
Old 05-10-2012, 10:16 PM
nelson.wells nelson.wells is offline
OBX.1 Kenobi
 
Join Date: Sep 2010
Posts: 26
nelson.wells is on a distinguished road
Default

I am running Mirth 2.2 on Windows 7.

And yes, "multiple messages" means I can send one message and it will work fine, but if I send more than one message in a short time, the HTTP request includes 2 cookie headers. I am not at a computer where I can reproduce the problem easily, but I will post the raw request tomorrow morning. I seem to recall there being something strange about the second cookie (something about a $version?)...
Reply With Quote
  #4  
Old 05-11-2012, 05:25 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Can you post your channel here (after cloning it and scrubbing out any passwords/PHI)?
Reply With Quote
  #5  
Old 05-11-2012, 08:24 AM
nelson.wells nelson.wells is offline
OBX.1 Kenobi
 
Join Date: Sep 2010
Posts: 26
nelson.wells is on a distinguished road
Default

I am attaching a copy of the channel definition and a screenshot of Wireshark output for the POST request with multiple cookies. Obviously, the end-points are faked since they are internal to our organization. The important bit is that the "login" destination sends back a valid cookie (with Set-Cookie header), the "get_cookie" destination parses the cookie out correctly, and the Cookie header that I explicitly set in "hpd" looks correct in the HTTP request. Unfortunately, you'll see in the screenshot that the actual request has two Cookie headers.

Thanks for looking into this. It's very puzzling.
Attached Images
File Type: jpg http_post_two_cookies.jpg (111.4 KB, 20 views)
File Type: jpg http_login.jpg (80.4 KB, 19 views)
Attached Files
File Type: xml channel_for_forums.xml (16.6 KB, 19 views)
Reply With Quote
  #6  
Old 05-11-2012, 09:49 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Hmm, I'm not able to reproduce that locally. Exactly what version are you on? 2.2.1.5861? Also, can you set up the channel to POST to another Mirth channel on the same server instead (essentially using a loopback device) and see if it does the same thing?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:46 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation