Cookie Manager -- JSESSIONID reused

2008-05-06 Thread Jason Frank
I am using JMeter 2.3.1 to test a java (Tomcat) web application.  My test 
involves a login, followed by an action that requires the user to be logged in. 
 I use an HTTP Cookie Manager in the Thread Group so that the second request 
will be recognized as "logged in", due to the JSESSIONID cookie that gets 
assigned during login.

I want to be able to "loop" over my test, so that it is repeated multiple 
times.  Therefore, I check the "clear cookies each iteration" box, so that on 
the second iteration it will not reuse the JSESSIONID that was assigned the 
first time.  So far, so good.  I can see the POST to my login page has no 
cookies each time, and the response contains a SET-COOKIE directive for 
JSESSIONID.

The problem comes when I want to use multiple threads.  Suppose I launch 2 
threads for this Thread Group.  Thread A makes a POST to the login page, with 
no cookies, and gets a response to set the JSESSIONID cookie.  Then, Thread B 
makes a POST to the login page, and (here is what I think the root of the 
problem is) it sends the same cookie value of JSESSIONID  that Thread A 
received.  The response to Thread B tells it to set a different value for 
JSESSIONID, so usually this results in two separate logins, but this doesn't 
always happen.  The result is that I sometimes have both threads using the same 
value for JSESSIONID, which causes problems later in my test.

Interestingly, if I don't check the box for "clear cookies each iteration", 
then Thread A and Thread B work fine -- Thread B's POST to the login page has 
no cookies, as it should.  However, this gets me into trouble when the threads 
go back for another iteration.  So I can set things up to *either* work for 
multiple threads, or for multiple loops, but not both.

Has anyone seen this behavior?  Is this a JMeter bug, or something that I am 
misunderstanding?



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cookie Manager -- JSESSIONID reused

2008-05-06 Thread sebb
2008/5/6 Jason Frank <[EMAIL PROTECTED]>:
> I am using JMeter 2.3.1 to test a java (Tomcat) web application.  My test 
> involves a login, followed by an action that requires the user to be logged 
> in.  I use an HTTP Cookie Manager in the Thread Group so that the second 
> request will be recognized as "logged in", due to the JSESSIONID cookie that 
> gets assigned during login.
>
>  I want to be able to "loop" over my test, so that it is repeated multiple 
> times.  Therefore, I check the "clear cookies each iteration" box, so that on 
> the second iteration it will not reuse the JSESSIONID that was assigned the 
> first time.  So far, so good.  I can see the POST to my login page has no 
> cookies each time, and the response contains a SET-COOKIE directive for 
> JSESSIONID.
>
>  The problem comes when I want to use multiple threads.  Suppose I launch 2 
> threads for this Thread Group.  Thread A makes a POST to the login page, with 
> no cookies, and gets a response to set the JSESSIONID cookie.  Then, Thread B 
> makes a POST to the login page, and (here is what I think the root of the 
> problem is) it sends the same cookie value of JSESSIONID  that Thread A 
> received.  The response to Thread B tells it to set a different value for 
> JSESSIONID, so usually this results in two separate logins, but this doesn't 
> always happen.  The result is that I sometimes have both threads using the 
> same value for JSESSIONID, which causes problems later in my test.
>
>  Interestingly, if I don't check the box for "clear cookies each iteration", 
> then Thread A and Thread B work fine -- Thread B's POST to the login page has 
> no cookies, as it should.  However, this gets me into trouble when the 
> threads go back for another iteration.  So I can set things up to *either* 
> work for multiple threads, or for multiple loops, but not both.
>
>  Has anyone seen this behavior?  Is this a JMeter bug, or something that I am 
> misunderstanding?
>

http://wiki.apache.org/jakarta-jmeter/CookieManagerBugIn231

>
>
>   
> 
>  Be a better friend, newshound, and
>  know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]