You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2006/05/09 22:03:16 UTC

DO NOT REPLY [Bug 39535] New: - HttpSampler2: No Cookies after following redirects

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535

           Summary: HttpSampler2: No Cookies after following redirects
           Product: JMeter
           Version: 2.1.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: steffen.bechtel@web.de


I am POSTING proper login data to a url which results in a redirect (302) with
the created application cookies. HttpSampler2 does not supply the cookies to the
resulting HTTP GET request.

Could someone please have a look at the methods "setConnectionCookie" and
"saveConnectionCookies"?

As a dirty hack I added the following source to the method "setupConnection"
right  after the line "String cookies = setConnectionCookie(httpMethod, u,
getCookieManager());":

if (getCookieManager() != null) {
    for (PropertyIterator iter = getCookieManager().getCookies().iterator();
iter.hasNext();) {
        Cookie cookie = (Cookie) iter.next().getObjectValue();
        org.apache.commons.httpclient.Cookie httpCookie = new
org.apache.commons.httpclient.Cookie();
        httpCookie.setDomain(cookie.getDomain());
        httpCookie.setDomainAttributeSpecified(true);
        httpCookie.setName(cookie.getName());
        httpCookie.setPath(cookie.getPath());
        httpCookie.setPathAttributeSpecified(true);
        httpCookie.setValue(cookie.getValue());
       	httpState.addCookie(httpCookie);
    }
}

It fixes my problem but I know that this is not the correct browser behaviour
(no URL, Path, expiration, etc. checks). Therefore I called this a "dirty hack".

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535


steffen.bechtel@web.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|HttpSampler2: No Cookies    |HttpSampler2: No Cookies
                   |after following redirects   |while following redirects




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535





------- Additional Comments From sebb@apache.org  2006-06-04 01:22 -------
I assume this is now fixed. If not (and if the current nightly also has the
problem) please reopen with details

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535





------- Additional Comments From steffen.bechtel@web.de  2006-05-16 22:35 -------
I enabled "Redirect Automatically" as well with no change (even compiled with
httpclient 2.0.2). Therefore I added my dirty hack code which finally helped
out. Didn't have the time to look at the issue in depth and I won't for quite
some time. Otherwise I would come up with the "real solution" instead of a hack.

Ethereal proved the issue. You can easyly reconstruct the scenario by posting
login data to the standard BEA WLS admin console following the redirects.

URL: http://localhost:7001/console/j_security_check
POST Data:
j_username = weblogic
j_password = weblogic

I would appreciate your investigation of this issue very much.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535


sebb@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From sebb@apache.org  2006-05-17 22:18 -------
I've updated the sampler so that Auto Redirect is handled correctly.
As far as I can make out, redirects do now work OK.
However, you cannot Autoredirect on a POST - HTTPClient does not allow it.

I could not find any problems with the cookie handling, so I've added some debug
logging - just enable debug for the sampler. You can do this with the new Help
Menu item - just select the Gui test element, click the appropriate Help item.

The nightly build 2-1.20060517 includes the redirect fix.

Please report any further problems...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535





------- Additional Comments From olivere@datacom.co.nz  2006-05-16 02:06 -------
Can confirm this on nightly build 2.1.2 from the 15.05.2006. Makes Sampler2
unusable on sites with redirect and cookies.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535





------- Additional Comments From sebb@apache.org  2006-05-16 23:18 -------
HTTPSampler2 is ignoring "Redirect automatically", and is treating "Follow
redirects" as if it was Redirect Automatically - so no wonder it made no difference.

I need to fix these bugs, and find out why the cookies are not being propagated.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535





------- Additional Comments From sebb@apache.org  2006-05-16 16:51 -------
Unless you need to see the redirects, try selecting "Redirect Automatically".

This should work - if not, please let us know.

Of course, the follow redirects should also work, but that may take longer to fix.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 39535] - HttpSampler2: No Cookies while following redirects

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39535>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39535


sebb@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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