You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by robert lazarski <ro...@gmail.com> on 2007/03/13 22:12:42 UTC

Baffled with cookie manager

Hi all,

I'm using JMeter again after a few years. I picked up my old test plan
and am running 2.2 . For the life of me I can't get cookies to be sent
to the server or get the cookies received from the login to be picked
up. I used to be able to do that fine.  What I did:

1) Added a thread group, and to that added the following:
2) Added a cookie manager.
3) Added a results tree.
4) Added an http request with all the right params to login, seems to
work as I can see a cookie returned and debugging on the server shows
all is ok.

However, the cookie manager shows no cookies! So I disabled the first
thread group and added a second. Repeated steps on 1-4, only now the
http request assumes a login has performed and does a query for data.
Also, I added the JSESSIONID returned from the first thread groups
result tree manually to the cookie manager in the second thread group.
First thread group has threads set to 0, also tried disabling. Using
wireshark on linux, I can't see the manual cookie I set being sent!
The request of course has an error, server debug shows no http session
and the results tree shows a new cookie along with errors.

I'm sure I'm doing something boneheaded, can a kind soul point the
error of my ways ;-) ?

Thanks,
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 18/03/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/18/07, robert lazarski <ro...@gmail.com> wrote:
> > On 3/18/07, sebb <se...@gmail.com> wrote:
> > > But if it needs is_isc_rpc=true, then either that needs to be provided
> > > via the URL or via the POST data.
> > >
> > > A well-written application will accept the parameter as POST data as
> > > well as in the URL, assuming that it handles POST.
> > >
> >
> > All the code uses request.getQueryString() to get the params. AFAIK,
> > that means it can't use post data, just the url. And the only way I
> > can get past the authentication is using ;jsessionid - as I just can't
> > seem to mimmick the way those cookies are being set. Am I right in
> > understanding that ;jsessionid and url param passing don't mix ?
> >
> > Thanks,
> > Robert
> >
>
> The ;jsessionid entry has to before the url params, in this form:
>
> /at/smartclient.form;jsessionid=54C636E67C40F36F3A56260C3B5CC798?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
>
> Man did I learn alot about the inner workings of http by solving this
> problem from beginning to end. Thanks alot Sebb, you were extremely
> helpful.

Glad it's been sorted.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/18/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/18/07, sebb <se...@gmail.com> wrote:
> > But if it needs is_isc_rpc=true, then either that needs to be provided
> > via the URL or via the POST data.
> >
> > A well-written application will accept the parameter as POST data as
> > well as in the URL, assuming that it handles POST.
> >
>
> All the code uses request.getQueryString() to get the params. AFAIK,
> that means it can't use post data, just the url. And the only way I
> can get past the authentication is using ;jsessionid - as I just can't
> seem to mimmick the way those cookies are being set. Am I right in
> understanding that ;jsessionid and url param passing don't mix ?
>
> Thanks,
> Robert
>

The ;jsessionid entry has to before the url params, in this form:

/at/smartclient.form;jsessionid=54C636E67C40F36F3A56260C3B5CC798?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0

Man did I learn alot about the inner workings of http by solving this
problem from beginning to end. Thanks alot Sebb, you were extremely
helpful.

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/18/07, sebb <se...@gmail.com> wrote:
> But if it needs is_isc_rpc=true, then either that needs to be provided
> via the URL or via the POST data.
>
> A well-written application will accept the parameter as POST data as
> well as in the URL, assuming that it handles POST.
>

All the code uses request.getQueryString() to get the params. AFAIK,
that means it can't use post data, just the url. And the only way I
can get past the authentication is using ;jsessionid - as I just can't
seem to mimmick the way those cookies are being set. Am I right in
understanding that ;jsessionid and url param passing don't mix ?

Thanks,
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 18/03/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/18/07, sebb <se...@gmail.com> wrote:
> > On 18/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > On 3/17/07, sebb <se...@gmail.com> wrote:
> > >
> > > >
> > > > The above line is not a standard HTTP header - or is there a blank
> > > > line missing before it?
> > >
> > > Here's the entire request - after login - I'm capturing from wireshark
> > > run from the browser:
> > >
> > > Hypertext Transfer Protocol
> > >    POST /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
> > > HTTP/1.1\r\n
> > >        Request Method: POST
> > >        Request URI:
> > > /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
> > >        Request Version: HTTP/1.1
> > >    Host: penguin.wazollc.net:8080\r\n
> > >    User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1.2)
> > > Gecko/20070220 Firefox/2.0.0.2\r\n
> > >    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
> > >    Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3\r\n
> > >    Accept-Encoding: gzip,deflate\r\n
> > >    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
> > >    Keep-Alive: 300\r\n
> > >    Connection: keep-alive\r\n
> > >    Referer: http://penguin.wazollc.net:8080/at/\r\n
> > >    Cookie: JSESSIONID=0AC67AD80A700A57714DA7E22BAFF574\r\n
> > >    Content-Type: application/x-www-form-urlencoded\r\n
> > >    Content-Length: 3437
> > >    \r\n
> > > Line-based text data: application/x-www-form-urlencoded
> > >    _transaction=%3Ctransaction+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum+xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FtransactionNum%3E%3Coperations+xsi%3Atype%3
> > >
> > > How do I send Line-based text data ? Do I need to set the headers Content-* ?
> >
> >
> > That's a bit clearer; I assume that "Line-based text data:
> > application/x-www-form-urlencoded" is a header added by Wireshark, so
> > the actual data is the stuff starting with:
> >
> > _transaction=xxxx
> >
> > This is a standard encoded POST message; all you need to do is to add
> > the appropriate parameters to the HTTP POST sampler.
> >
> > In this case, the parameters are a bit tricky to determine, but
> > Wireshark may do it for you, or I found the following decoder page:
> >
> > http://ostermiller.org/calc/encode.html
> >
> > Or you can try using the HTTP Proxy recorder. Read the manual for details.
> >
>
> I'm all so close. Inside the code I didn't write we do:
>
> public static boolean isRPC(HttpServletRequest httpservletrequest)
>    {
>        String s = httpservletrequest.getQueryString();
>        if(s == null)
>            return false;
>        else
>            return s.indexOf("is_isc_rpc=true") != -1;
>    }
>
> Working httpservletrequest.getQueryString() from browser -->
> is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
>
> From JMeter is null. I think this is because I put the ;jsession tag
> on the url to associate the cookie:
>
> POST http://penguin.wazollc.net:8080/at/smartclient.form;jsessionid=C9981CC5C312D62EFED889AE5816A841
>
> And passing the is_isc_rpc=true via a param. Hopefully this is the
> last question - thanks for the help!

No idea what that code does.

But if it needs is_isc_rpc=true, then either that needs to be provided
via the URL or via the POST data.

A well-written application will accept the parameter as POST data as
well as in the URL, assuming that it handles POST.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/18/07, sebb <se...@gmail.com> wrote:
> On 18/03/07, robert lazarski <ro...@gmail.com> wrote:
> > On 3/17/07, sebb <se...@gmail.com> wrote:
> >
> > >
> > > The above line is not a standard HTTP header - or is there a blank
> > > line missing before it?
> >
> > Here's the entire request - after login - I'm capturing from wireshark
> > run from the browser:
> >
> > Hypertext Transfer Protocol
> >    POST /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
> > HTTP/1.1\r\n
> >        Request Method: POST
> >        Request URI:
> > /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
> >        Request Version: HTTP/1.1
> >    Host: penguin.wazollc.net:8080\r\n
> >    User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1.2)
> > Gecko/20070220 Firefox/2.0.0.2\r\n
> >    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
> >    Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3\r\n
> >    Accept-Encoding: gzip,deflate\r\n
> >    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
> >    Keep-Alive: 300\r\n
> >    Connection: keep-alive\r\n
> >    Referer: http://penguin.wazollc.net:8080/at/\r\n
> >    Cookie: JSESSIONID=0AC67AD80A700A57714DA7E22BAFF574\r\n
> >    Content-Type: application/x-www-form-urlencoded\r\n
> >    Content-Length: 3437
> >    \r\n
> > Line-based text data: application/x-www-form-urlencoded
> >    _transaction=%3Ctransaction+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum+xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FtransactionNum%3E%3Coperations+xsi%3Atype%3
> >
> > How do I send Line-based text data ? Do I need to set the headers Content-* ?
>
>
> That's a bit clearer; I assume that "Line-based text data:
> application/x-www-form-urlencoded" is a header added by Wireshark, so
> the actual data is the stuff starting with:
>
> _transaction=xxxx
>
> This is a standard encoded POST message; all you need to do is to add
> the appropriate parameters to the HTTP POST sampler.
>
> In this case, the parameters are a bit tricky to determine, but
> Wireshark may do it for you, or I found the following decoder page:
>
> http://ostermiller.org/calc/encode.html
>
> Or you can try using the HTTP Proxy recorder. Read the manual for details.
>

I'm all so close. Inside the code I didn't write we do:

public static boolean isRPC(HttpServletRequest httpservletrequest)
    {
        String s = httpservletrequest.getQueryString();
        if(s == null)
            return false;
        else
            return s.indexOf("is_isc_rpc=true") != -1;
    }

Working httpservletrequest.getQueryString() from browser -->
is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0

>From JMeter is null. I think this is because I put the ;jsession tag
on the url to associate the cookie:

POST http://penguin.wazollc.net:8080/at/smartclient.form;jsessionid=C9981CC5C312D62EFED889AE5816A841

And passing the is_isc_rpc=true via a param. Hopefully this is the
last question - thanks for the help!

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 18/03/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/17/07, sebb <se...@gmail.com> wrote:
>
> >
> > The above line is not a standard HTTP header - or is there a blank
> > line missing before it?
>
> Here's the entire request - after login - I'm capturing from wireshark
> run from the browser:
>
> Hypertext Transfer Protocol
>    POST /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
> HTTP/1.1\r\n
>        Request Method: POST
>        Request URI:
> /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
>        Request Version: HTTP/1.1
>    Host: penguin.wazollc.net:8080\r\n
>    User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1.2)
> Gecko/20070220 Firefox/2.0.0.2\r\n
>    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
>    Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3\r\n
>    Accept-Encoding: gzip,deflate\r\n
>    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
>    Keep-Alive: 300\r\n
>    Connection: keep-alive\r\n
>    Referer: http://penguin.wazollc.net:8080/at/\r\n
>    Cookie: JSESSIONID=0AC67AD80A700A57714DA7E22BAFF574\r\n
>    Content-Type: application/x-www-form-urlencoded\r\n
>    Content-Length: 3437
>    \r\n
> Line-based text data: application/x-www-form-urlencoded
>    _transaction=%3Ctransaction+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum+xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FtransactionNum%3E%3Coperations+xsi%3Atype%3
>
> How do I send Line-based text data ? Do I need to set the headers Content-* ?


That's a bit clearer; I assume that "Line-based text data:
application/x-www-form-urlencoded" is a header added by Wireshark, so
the actual data is the stuff starting with:

_transaction=xxxx

This is a standard encoded POST message; all you need to do is to add
the appropriate parameters to the HTTP POST sampler.

In this case, the parameters are a bit tricky to determine, but
Wireshark may do it for you, or I found the following decoder page:

http://ostermiller.org/calc/encode.html

Or you can try using the HTTP Proxy recorder. Read the manual for details.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/17/07, sebb <se...@gmail.com> wrote:

>
> The above line is not a standard HTTP header - or is there a blank
> line missing before it?

Here's the entire request - after login - I'm capturing from wireshark
run from the browser:

Hypertext Transfer Protocol
    POST /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
HTTP/1.1\r\n
        Request Method: POST
        Request URI:
/at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0
        Request Version: HTTP/1.1
    Host: penguin.wazollc.net:8080\r\n
    User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1.2)
Gecko/20070220 Firefox/2.0.0.2\r\n
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
    Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Keep-Alive: 300\r\n
    Connection: keep-alive\r\n
    Referer: http://penguin.wazollc.net:8080/at/\r\n
    Cookie: JSESSIONID=0AC67AD80A700A57714DA7E22BAFF574\r\n
    Content-Type: application/x-www-form-urlencoded\r\n
    Content-Length: 3437
    \r\n
Line-based text data: application/x-www-form-urlencoded
    _transaction=%3Ctransaction+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum+xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FtransactionNum%3E%3Coperations+xsi%3Atype%3


How do I send Line-based text data ? Do I need to set the headers Content-* ?

Thanks!
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 17/03/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/17/07, sebb <se...@gmail.com> wrote:
> > On 17/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > On 3/14/07, sebb <se...@gmail.com> wrote:
> > > > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > > > On 3/14/07, sebb <se...@gmail.com> wrote:
> > > > > > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > > You may need the referer (sic) header.
> > > >
> > > > > 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
> > > > >
> > >
> > > OK, I figured out how to pass the cookie via the url by teminating
> > > with ;jsessionid . So after logging in with this url and the
> > > parameters set:
> > >
> > > /at/j_acegi_security_check
> > >
> > > That returns a cookie. I can then send this url:
> > >
> > > /at/j_acegi_security_check;jsessionid=2434FB90D8E1983245436D0C517898BF
> >
> > Which is not a cookie ...
> >
> > >
> > > And it will acknowledge is was already authenticated. The problem:
> > > That won't work for the next data request. I can pass this url and it
> > > will indeed get past the authentication:
> > >
> > > /at/smartclient.form;jsessionid=2434FB90D8E1983245436D0C517898BF
> > >
> > > However, that will throw an exception because  /at/smartclient.form is
> > > expecting params. For example, this would be ideal:
> > >
> > > /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0;jsessionid=2434FB90D8E1983245436D0C517898BF
> > >
> > These are parameters; add them to the http request.
> >
> > > but the authentication does not acknowledge the cookie. I cannot get
> > > the cookie manager to pass this cookie manually or automatically as
> > > done with ;jsession to indicate previous authentication to either the
> > > login or to smartclient.form.
> > >
> > > Any ideas?
> >
> > If the value of jsessionid is expected by the server to be present in
> > the URL, then it is not using jsessionid as a cookie.
> >
> > Have you looked at URL Rewriting:
> >
> > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_URL_Re-writing_Modifier
> >
>
> HTTP_URL_Re-writing_Modifier seems to be working for the
> authentication. However, there is some funky rpc thing going on inside
> the proprietary rich client thing we are using. Here's what live
> headers show when run from the browser. :
>
> POST /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=1

These are just HTTP parameters

> HTTP/1.1
> Host: penguin.wazollc.net:8080
> User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.0.6)
> Gecko/20060728 SUSE/1.5.0.6-1.3 Firefox/1.5.0.6
> 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: pt-br,pt;q=0.8,en-us;q=0.5,en;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.wazollc.net:8080/at/
> Cookie: JSESSIONID=9F1CE84ADE39EE37157C88D16039FF23
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 927
> _transaction=%3Ctransaction+xmlns%3Axsi%3D%22http%3A%2F%[...]
3E&protocolVersion=1.0&__iframeTarget__=isc_HiddenFrame_465

The above line is not a standard HTTP header - or is there a blank
line missing before it?

> HTTP/1.x 200 OK

Where does that come from?

> So my problem is by using jmeter's XML-RPC request I can't get it to

Why are  you using XML-RPC?

> work with HTTP_URL_Re-writing_Modifier. I did set 'Content-Type:
> application/x-www-form-urlencoded' as a header. Strangely to me, the
> POST above sets a cookie.

Cookies will be sent if there is one that matches the URL.

> Anyways, how one might set a cookie or rewrite the url to have
> ;jsession , using XML-RPC request?

The above POST does not need URL rewriting; it just needs the
appropriate parameters.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/17/07, sebb <se...@gmail.com> wrote:
> On 17/03/07, robert lazarski <ro...@gmail.com> wrote:
> > On 3/14/07, sebb <se...@gmail.com> wrote:
> > > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > > On 3/14/07, sebb <se...@gmail.com> wrote:
> > > > > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > You may need the referer (sic) header.
> > >
> > > > 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
> > > >
> >
> > OK, I figured out how to pass the cookie via the url by teminating
> > with ;jsessionid . So after logging in with this url and the
> > parameters set:
> >
> > /at/j_acegi_security_check
> >
> > That returns a cookie. I can then send this url:
> >
> > /at/j_acegi_security_check;jsessionid=2434FB90D8E1983245436D0C517898BF
>
> Which is not a cookie ...
>
> >
> > And it will acknowledge is was already authenticated. The problem:
> > That won't work for the next data request. I can pass this url and it
> > will indeed get past the authentication:
> >
> > /at/smartclient.form;jsessionid=2434FB90D8E1983245436D0C517898BF
> >
> > However, that will throw an exception because  /at/smartclient.form is
> > expecting params. For example, this would be ideal:
> >
> > /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0;jsessionid=2434FB90D8E1983245436D0C517898BF
> >
> These are parameters; add them to the http request.
>
> > but the authentication does not acknowledge the cookie. I cannot get
> > the cookie manager to pass this cookie manually or automatically as
> > done with ;jsession to indicate previous authentication to either the
> > login or to smartclient.form.
> >
> > Any ideas?
>
> If the value of jsessionid is expected by the server to be present in
> the URL, then it is not using jsessionid as a cookie.
>
> Have you looked at URL Rewriting:
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_URL_Re-writing_Modifier
>

HTTP_URL_Re-writing_Modifier seems to be working for the
authentication. However, there is some funky rpc thing going on inside
the proprietary rich client thing we are using. Here's what live
headers show when run from the browser. :

POST /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=1
HTTP/1.1
Host: penguin.wazollc.net:8080
User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.0.6)
Gecko/20060728 SUSE/1.5.0.6-1.3 Firefox/1.5.0.6
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: pt-br,pt;q=0.8,en-us;q=0.5,en;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.wazollc.net:8080/at/
Cookie: JSESSIONID=9F1CE84ADE39EE37157C88D16039FF23
Content-Type: application/x-www-form-urlencoded
Content-Length: 927
_transaction=%3Ctransaction+xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum+xsi%3Atype%3D%22xsd%3Along%22%3E1%3C%2FtransactionNum%3E%3Coperations+xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem+xsi%3Atype%3D%22xsd%3AObject%22%3E%3Cwhere+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CfundID+xsi%3Atype%3D%22xsd%3Along%22%3E14%3C%2FfundID%3E%3C%2Fwhere%3E%3CoperationConfig+xsi%3Atype%3D%22xsd%3AObject%22%3E%3CdataSource%3EFund%3C%2FdataSource%3E%3CoperationType%3Efetch%3C%2FoperationType%3E%3CtextMatchStyle%3Esubstring%3C%2FtextMatchStyle%3E%3C%2FoperationConfig%3E%3CappID%3EbuiltinApplication%3C%2FappID%3E%3Coperation%3EFund_fetch%3C%2Foperation%3E%3C%2Felem%3E%3C%2Foperations%3E%3Cjscallback%3Eparent.isc.RPCManager.performTransactionReply%281%2C+results%29%3B%3C%2Fjscallback%3E%3C%2Ftransaction%3E&protocolVersion=1.0&__iframeTarget__=isc_HiddenFrame_465
HTTP/1.x 200 OK

So my problem is by using jmeter's XML-RPC request I can't get it to
work with HTTP_URL_Re-writing_Modifier. I did set 'Content-Type:
application/x-www-form-urlencoded' as a header. Strangely to me, the
POST above sets a cookie.
Anyways, how one might set a cookie or rewrite the url to have
;jsession , using XML-RPC request?

Thanks sebb, very much appreciated,
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 17/03/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/14/07, sebb <se...@gmail.com> wrote:
> > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > On 3/14/07, sebb <se...@gmail.com> wrote:
> > > > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > You may need the referer (sic) header.
> >
> > > 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
> > >
>
> OK, I figured out how to pass the cookie via the url by teminating
> with ;jsessionid . So after logging in with this url and the
> parameters set:
>
> /at/j_acegi_security_check
>
> That returns a cookie. I can then send this url:
>
> /at/j_acegi_security_check;jsessionid=2434FB90D8E1983245436D0C517898BF

Which is not a cookie ...

>
> And it will acknowledge is was already authenticated. The problem:
> That won't work for the next data request. I can pass this url and it
> will indeed get past the authentication:
>
> /at/smartclient.form;jsessionid=2434FB90D8E1983245436D0C517898BF
>
> However, that will throw an exception because  /at/smartclient.form is
> expecting params. For example, this would be ideal:
>
> /at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0;jsessionid=2434FB90D8E1983245436D0C517898BF
>
These are parameters; add them to the http request.

> but the authentication does not acknowledge the cookie. I cannot get
> the cookie manager to pass this cookie manually or automatically as
> done with ;jsession to indicate previous authentication to either the
> login or to smartclient.form.
>
> Any ideas?

If the value of jsessionid is expected by the server to be present in
the URL, then it is not using jsessionid as a cookie.

Have you looked at URL Rewriting:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_URL_Re-writing_Modifier

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/14/07, sebb <se...@gmail.com> wrote:
> On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> > On 3/14/07, sebb <se...@gmail.com> wrote:
> > > On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> You may need the referer (sic) header.
>
> > 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
> >

OK, I figured out how to pass the cookie via the url by teminating
with ;jsessionid . So after logging in with this url and the
parameters set:

/at/j_acegi_security_check

That returns a cookie. I can then send this url:

/at/j_acegi_security_check;jsessionid=2434FB90D8E1983245436D0C517898BF

And it will acknowledge is was already authenticated. The problem:
That won't work for the next data request. I can pass this url and it
will indeed get past the authentication:

/at/smartclient.form;jsessionid=2434FB90D8E1983245436D0C517898BF

However, that will throw an exception because  /at/smartclient.form is
expecting params. For example, this would be ideal:

/at/smartclient.form?is_isc_rpc=true&isc_clientVersion=5.6b2&iscTNum=0;jsessionid=2434FB90D8E1983245436D0C517898BF

but the authentication does not acknowledge the cookie. I cannot get
the cookie manager to pass this cookie manually or automatically as
done with ;jsession to indicate previous authentication to either the
login or to smartclient.form.

Any ideas?
Robert

 I can pass the login url with ;jessionid and the cookie returned from
the first login and it will acknowledge that it was previously

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 14/03/07, robert lazarski <ro...@gmail.com> wrote:
> On 3/14/07, sebb <se...@gmail.com> wrote:
> > On 14/03/07, robert lazarski <ro...@gmail.com> 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=/

OK

> 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

So JMeter is sending the cookie as expected.

>    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

So the server is returning a new Cookie - that's its choice.

>    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 ?
>

See below.

>
> 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

You may need the referer (sic) header.

> 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: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
On 3/14/07, sebb <se...@gmail.com> wrote:
> On 14/03/07, robert lazarski <ro...@gmail.com> 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: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
On 14/03/07, robert lazarski <ro...@gmail.com> 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?

> 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.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
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=/

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

Thanks!
Robert



On 3/13/07, sebb <se...@gmail.com> wrote:
> Manually added cookies will be sent if they qualify; same as for
> cookies sent by the server.
>
> However if you select "clear cookies each iteration" they will only be
> sent the first time through the main loop.
>
> Cookies can be seen in the Tree View Listener.
>
> On 13/03/07, robert lazarski <ro...@gmail.com> wrote:
> > Ahh, thanks. Is it true that manually added cookies should be sent to
> > the server? Any guess on why they don't seem to be sent by my config
> > as I tried to explain it ?
> >
> > Robert
> >
> > On 3/13/07, sebb <se...@gmail.com> wrote:
> > > The Cookie Manager does not show the cookies; only manually added
> > > cookies appear on the screen.
> > >
> > >
> > > On 13/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > > Hi all,
> > > >
> > > > I'm using JMeter again after a few years. I picked up my old test plan
> > > > and am running 2.2 . For the life of me I can't get cookies to be sent
> > > > to the server or get the cookies received from the login to be picked
> > > > up. I used to be able to do that fine.  What I did:
> > > >
> > > > 1) Added a thread group, and to that added the following:
> > > > 2) Added a cookie manager.
> > > > 3) Added a results tree.
> > > > 4) Added an http request with all the right params to login, seems to
> > > > work as I can see a cookie returned and debugging on the server shows
> > > > all is ok.
> > > >
> > > > However, the cookie manager shows no cookies! So I disabled the first
> > > > thread group and added a second. Repeated steps on 1-4, only now the
> > > > http request assumes a login has performed and does a query for data.
> > > > Also, I added the JSESSIONID returned from the first thread groups
> > > > result tree manually to the cookie manager in the second thread group.
> > > > First thread group has threads set to 0, also tried disabling. Using
> > > > wireshark on linux, I can't see the manual cookie I set being sent!
> > > > The request of course has an error, server debug shows no http session
> > > > and the results tree shows a new cookie along with errors.
> > > >
> > > > I'm sure I'm doing something boneheaded, can a kind soul point the
> > > > error of my ways ;-) ?
> > > >
> > > > Thanks,
> > > > Robert
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
Manually added cookies will be sent if they qualify; same as for
cookies sent by the server.

However if you select "clear cookies each iteration" they will only be
sent the first time through the main loop.

Cookies can be seen in the Tree View Listener.

On 13/03/07, robert lazarski <ro...@gmail.com> wrote:
> Ahh, thanks. Is it true that manually added cookies should be sent to
> the server? Any guess on why they don't seem to be sent by my config
> as I tried to explain it ?
>
> Robert
>
> On 3/13/07, sebb <se...@gmail.com> wrote:
> > The Cookie Manager does not show the cookies; only manually added
> > cookies appear on the screen.
> >
> >
> > On 13/03/07, robert lazarski <ro...@gmail.com> wrote:
> > > Hi all,
> > >
> > > I'm using JMeter again after a few years. I picked up my old test plan
> > > and am running 2.2 . For the life of me I can't get cookies to be sent
> > > to the server or get the cookies received from the login to be picked
> > > up. I used to be able to do that fine.  What I did:
> > >
> > > 1) Added a thread group, and to that added the following:
> > > 2) Added a cookie manager.
> > > 3) Added a results tree.
> > > 4) Added an http request with all the right params to login, seems to
> > > work as I can see a cookie returned and debugging on the server shows
> > > all is ok.
> > >
> > > However, the cookie manager shows no cookies! So I disabled the first
> > > thread group and added a second. Repeated steps on 1-4, only now the
> > > http request assumes a login has performed and does a query for data.
> > > Also, I added the JSESSIONID returned from the first thread groups
> > > result tree manually to the cookie manager in the second thread group.
> > > First thread group has threads set to 0, also tried disabling. Using
> > > wireshark on linux, I can't see the manual cookie I set being sent!
> > > The request of course has an error, server debug shows no http session
> > > and the results tree shows a new cookie along with errors.
> > >
> > > I'm sure I'm doing something boneheaded, can a kind soul point the
> > > error of my ways ;-) ?
> > >
> > > Thanks,
> > > Robert
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by robert lazarski <ro...@gmail.com>.
Ahh, thanks. Is it true that manually added cookies should be sent to
the server? Any guess on why they don't seem to be sent by my config
as I tried to explain it ?

Robert

On 3/13/07, sebb <se...@gmail.com> wrote:
> The Cookie Manager does not show the cookies; only manually added
> cookies appear on the screen.
>
>
> On 13/03/07, robert lazarski <ro...@gmail.com> wrote:
> > Hi all,
> >
> > I'm using JMeter again after a few years. I picked up my old test plan
> > and am running 2.2 . For the life of me I can't get cookies to be sent
> > to the server or get the cookies received from the login to be picked
> > up. I used to be able to do that fine.  What I did:
> >
> > 1) Added a thread group, and to that added the following:
> > 2) Added a cookie manager.
> > 3) Added a results tree.
> > 4) Added an http request with all the right params to login, seems to
> > work as I can see a cookie returned and debugging on the server shows
> > all is ok.
> >
> > However, the cookie manager shows no cookies! So I disabled the first
> > thread group and added a second. Repeated steps on 1-4, only now the
> > http request assumes a login has performed and does a query for data.
> > Also, I added the JSESSIONID returned from the first thread groups
> > result tree manually to the cookie manager in the second thread group.
> > First thread group has threads set to 0, also tried disabling. Using
> > wireshark on linux, I can't see the manual cookie I set being sent!
> > The request of course has an error, server debug shows no http session
> > and the results tree shows a new cookie along with errors.
> >
> > I'm sure I'm doing something boneheaded, can a kind soul point the
> > error of my ways ;-) ?
> >
> > Thanks,
> > Robert
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Baffled with cookie manager

Posted by sebb <se...@gmail.com>.
The Cookie Manager does not show the cookies; only manually added
cookies appear on the screen.


On 13/03/07, robert lazarski <ro...@gmail.com> wrote:
> Hi all,
>
> I'm using JMeter again after a few years. I picked up my old test plan
> and am running 2.2 . For the life of me I can't get cookies to be sent
> to the server or get the cookies received from the login to be picked
> up. I used to be able to do that fine.  What I did:
>
> 1) Added a thread group, and to that added the following:
> 2) Added a cookie manager.
> 3) Added a results tree.
> 4) Added an http request with all the right params to login, seems to
> work as I can see a cookie returned and debugging on the server shows
> all is ok.
>
> However, the cookie manager shows no cookies! So I disabled the first
> thread group and added a second. Repeated steps on 1-4, only now the
> http request assumes a login has performed and does a query for data.
> Also, I added the JSESSIONID returned from the first thread groups
> result tree manually to the cookie manager in the second thread group.
> First thread group has threads set to 0, also tried disabling. Using
> wireshark on linux, I can't see the manual cookie I set being sent!
> The request of course has an error, server debug shows no http session
> and the results tree shows a new cookie along with errors.
>
> I'm sure I'm doing something boneheaded, can a kind soul point the
> error of my ways ;-) ?
>
> Thanks,
> Robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org