On 3/14/07, sebb <[EMAIL PROTECTED]> wrote:
On 14/03/07, robert lazarski <[EMAIL PROTECTED]> wrote:
> I'm now trying to use the cookie manager to do the management for me,
> ie, not set the cookie manually. Here's what's confusing me:
>
> In the app run from a browser, firefox live headers shows that the
> splash page sets a cookie. The login passes the same cookie, Doing
> this with Jmeter, I have a test plan with these added to a thread
> group:
>
> 1) Cookie manager - no entries.
> 2) HTTP request --> Splash page
> 3) HTTP request --> Login
> 4) HTTP request --> Generic data request.
> 5) Results tree.
>
> So in the results tree, the splash page shows:
>
> Set-Cookie: JSESSIONID=0DCBD82A086499D0736DF893472FF00D; Path=/
>
> However, the login page results tree shows a new cookie
>
> Set-Cookie: JSESSIONID=B896AFE21E538E11D219023ACC1EDA66; Path=/

What Cookie is passed to the login page?

Here's another run. This is wireshark on the server:

HTTP/1.1 200 OK\r\n
       Request Version: HTTP/1.1
       Response Code: 200
   Server: Apache-Coyote/1.1\r\n
   X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build:
CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5\r\n
   Set-Cookie: JSESSIONID=53D5A82C4A04FBD90031EB0B9F059664; Path=/\r\n
   Content-Type: text/html;charset=ISO-8859-1\r\n
   Content-Length: 5929
   Date: Wed, 14 Mar 2007 16:47:37 GMT\r\n

Clicking on the results tree confirms this cookie:

Set-Cookie: JSESSIONID=53D5A82C4A04FBD90031EB0B9F059664; Path=/

And here's the wireshark entry for the login page params being sent:

POST /at/j_acegi_security_check HTTP/1.1\r\n
       Request Method: POST
       Request URI: /at/j_acegi_security_check
       Request Version: HTTP/1.1
   Connection: keep-alive\r\n
   Cookie: JSESSIONID=53D5A82C4A04FBD90031EB0B9F059664\r\n
   Content-Length: 93
   Content-Type: application/x-www-form-urlencoded\r\n
   User-Agent: Java/1.5.0_08\r\n
   Host: penguin.myserver.net:8080\r\n
   Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\r\n
   \r\n
Line-based text data: application/x-www-form-urlencoded
   
j_username=xxx%40yahoo.com+&j_password=yyy1&submit.x=18&submit.y=5&submit=Login

However, it seems the cookie is being reset as when I click on the
results tree pane for the login request, I get:

Set-Cookie: JSESSIONID=4A2565D99C4B5F82A8B1056FC938D326; Path=/

And wireshark shows:

  HTTP/1.1 200 OK\r\n
       Request Version: HTTP/1.1
       Response Code: 200
   Server: Apache-Coyote/1.1\r\n
   X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build:
CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5\r\n
   Set-Cookie: JSESSIONID=4A2565D99C4B5F82A8B1056FC938D326; Path=/\r\n
   Content-Type: text/html;charset=ISO-8859-1\r\n
   Content-Length: 5929
   Date: Wed, 14 Mar 2007 16:47:42 GMT\r\n


> Any idea how to get the same cookie from the splash page passed into
> all subsequent requests?
>

If the server sends a new value for an existing cookie, then JMeter
will send the new value - the old value will be lost. This is what
browsers do as well.

The question is - why is the login page returning a different cookie?
That depends on the server application and possibly some headers that
are sent or not sent by JMeter.

That is the question. Here's the firefox live headers entries I get
when running the login from firefox - my eyes can't seem to find
anything sticking out. Anyone see any clues ?


http://penguin.myserver.net:8080/at/j_acegi_security_check?section=

POST /at/j_acegi_security_check?section= HTTP/1.1
Host: penguin.myserver.net:8080
User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1)
Gecko/20061023 SUSE/2.0-30 Firefox/2.0
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,pt-br;q=0.8,en;q=0.5,pt;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://penguin.myserver.net:8080/at/public/index.jsp
Cookie: JSESSIONID=8EF794277593CDAE19A765619417894C
Content-Type: application/x-www-form-urlencoded
Content-Length: 92
j_username=xxx%40yahoo.com&j_password=yyy1&submit.x=22&submit.y=9&submit=Login
HTTP/1.x 302 Moved Temporarily
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0
date=200610162339)/Tomcat-5.5
Location: http://penguin.wazollc.net:8080/at/
Content-Length: 0
Date: Wed, 14 Mar 2007 17:13:58 GMT
----------------------------------------------------------
http://penguin.myserver.net:8080/at/

GET /at/ HTTP/1.1
Host: penguin.wazollc.net:8080
User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1)
Gecko/20061023 SUSE/2.0-30 Firefox/2.0
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,pt-br;q=0.8,en;q=0.5,pt;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://penguin.myserver.net:8080/at/public/index.jsp
Cookie: JSESSIONID=8EF794277593CDAE19A765619417894C

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0
date=200610162339)/Tomcat-5.5

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

Reply via email to