Bug 63520 - Malformed Cookie Exception When Jmeter tries to add Amazon AWSALB Cookie
Summary: Malformed Cookie Exception When Jmeter tries to add Amazon AWSALB Cookie
Status: RESOLVED WORKSFORME
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.3
Hardware: PC All
: P2 trivial (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-20 07:25 UTC by SUHAIL
Modified: 2019-07-23 11:50 UTC (History)
1 user (show)



Attachments
Usage of sample cookie with http mirror (7.33 KB, application/xml)
2019-06-27 06:30 UTC, Felix Schumacher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SUHAIL 2019-06-20 07:25:31 UTC
Greetings!

I need to do load testing on Amazon AWS cloud for an application which requires Sticky sessions. AWS ELB sends a cookie called AWSALB for sticky sessions.

JMeter is not able to add the cookie as it finds it to be malformed. I do not want to run the test without disabling Sticky sessions, hence, the cookie will exist. How do i make sure JMeter accepts this cookie?

I tried using all the Cookie Manager's policy inc Netscape but this doesn't work and gives me the below exception. Can someone please look into this.

Typical Cookie:

AWSALB=Xvt/JIiJPAVz4+lK8F+ULq2317adfZ/mRzKPEzQ2gH7PBJU77S8eUZpZpleVCm6ooYzkhyxA5eUIkCOSOB4jIoKzLYG71rtQ9y9/F/OWJRYgHMKiCCD0p122YUyn; Expires=Mon, 24 Jun 2019 11:23:51 GMT; Path=/

Error in Jmeter Log:
2019-06-17 16:53:54,532 ERROR o.a.j.p.h.c.HC4CookieHandler: Unable to add the cookie org.apache.http.cookie.MalformedCookieException: Invalid 'expires' attribute: Mon, 24 Jun 2019 11:23:54 GMT at 
org.apache.http.impl.cookie.BasicExpiresHandler.parse(BasicExpiresHandler.java:64) ~[httpclient-4.5.3.jar:4.5.3] at org.apache.http.impl.cookie.CookieSpecBase.parse(CookieSpecBase.java:113) ~[httpclient-4.5.3.jar:4.5.3] at 
org.apache.http.impl.cookie.NetscapeDraftSpec.parse(NetscapeDraftSpec.java:134) ~[httpclient-4.5.3.jar:4.5.3]

Many Thanks,
Suhail
Comment 1 Felix Schumacher 2019-06-20 12:05:00 UTC
Please ask questions about using JMeter on the mailing list. 

If I read the stacktrace correctly, you have configured an ancient Cookie Spec in your Cookie Manager. See http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager for more information. The recommended Cookie Policy is "standard".
Comment 2 SUHAIL 2019-06-21 06:44:00 UTC
Hi felix,

As i mentioned i tried with all cookie policies including standard.
When using Standard Jmeter doesnt even list the Cookie in the Request headers if i see the view results tree.
Can you provide me with the mailing list to ask questions?

Thanks,
Suhail
Comment 3 Felix Schumacher 2019-06-21 18:12:01 UTC
I didn't read carefully enough and didn't see, that you tried to use all implementations. I suspect that you didn't hit the right knob to change it, though. 

The mailing lists and how to use them are described at https://jmeter.apache.org/mail2.html

A minimal testcase that reproduces the error is always helpful.
Comment 4 Felix Schumacher 2019-06-27 06:30:23 UTC
Created attachment 36637 [details]
Usage of sample cookie with http mirror

The attached sample plan uses the cookie from the example above and parses it with the standard cookie manager. It shows no problems -- except when used with the netscape mode.

To use the test plan you have to start the embedded http mirror element before running the plan.
Comment 5 Philippe Mouawad 2019-07-07 12:43:17 UTC
Closing as no feedback.
Feel free to reopen by answering Felix's request
Comment 6 The ASF infrastructure team 2022-09-24 20:38:17 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5106