PermaLink Cookies Not Being Set From Redirects During Login in JMeter09/09/2011 07:17 PM
Since this took a while to find, I thought it was worth a blog post in case anyone else runs into it.  When you use BadBoy to capture a script for JMeter, it sets the HTTP Request implementation to Java, which does have limitations, and to Redirect Automatically instead of Follow Redirects.  The problem with this, if you use cookies for session logins, is that most login implementations will do a redirect (302) after the post w/ the username/password and this redirect contains the session cookies (.ASPXFORMSAUTH in ASP.Net) that are set during the redirect to indicate the user is "logged in" and JMeter will only read these cookies into the Cookie Manager if you have Follow Redirects turned on:
Image:Ken's Blog - Cookies Not Being Set From Redirects During Login in JMeter
Oddly enough, you can also set the HTTP Request implementation to HttpClient4 and it will work fine no matter which checkbox is selected.  The checkbox should really be a radiobutton instead too, but that's a JMeter UI quirk

You also have to set the HTTP Cookie Manager to Compatibility mode (it defaults to RFC2109 which doesn't always handle cookies properly because not all web servers follow those guidelines):
Image:Ken's Blog - Cookies Not Being Set From Redirects During Login in JMeter

Comments :v

1. Pradeep12/13/2014 10:18:05


i was searching for this solution on urjent basis and ur post really work like charm :)




2. Itai03/19/2012 09:00:21
Homepage: http://www.seperia.com


Hi Ken,
Nice post.
I used Jmeter before and then came across the Cassandra JMeter plugin and better yet - BlazeMeter.com. I'd suggest to check it out, can save a lot of time on testing, too. At least for it did for my team.
Cheers, mate.




Start Pages
RSS News Feed RSS Comments Feed CoComment Integrated
The BlogRoll
Calendar
November 2024
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Search
Contact Me
About Ken
Full-stack developer (consultant) working with .Net, Java, Android, Javascript (jQuery, Meteor.js, AngularJS), Lotus Domino