Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DF87810109 for ; Tue, 29 Apr 2014 21:12:59 +0000 (UTC) Received: (qmail 79050 invoked by uid 500); 29 Apr 2014 21:12:58 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 79015 invoked by uid 500); 29 Apr 2014 21:12:58 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 78989 invoked by uid 99); 29 Apr 2014 21:12:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 21:12:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shmulikk@gmail.com designates 209.85.128.172 as permitted sender) Received: from [209.85.128.172] (HELO mail-ve0-f172.google.com) (209.85.128.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 21:12:52 +0000 Received: by mail-ve0-f172.google.com with SMTP id jy13so1038774veb.3 for ; Tue, 29 Apr 2014 14:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=C147HAIgStDuy/HARNgRaJ927ue9JOV1BSP352OvYh4=; b=sfT5kii8Zli7k6XoXVo6VeCelRf61HgoLPZPzqiPQYG3GrmrMFPJcbj7yR3yw03LLS Wq9gNnNMKEUauI9LyV3MiSuw00w16UFPuSLE7XbtIyT02W/abJSJP+NvUbH2QqsWb3bM Q7tFb1bfFAruCjU3DP5OubBVQyRvK1pTFFkJENVcLJbUGJthot+enZgY8RXDiqOIw1JR 86kPnVBX+ApRoKb4RLd2BgSddS6OY79eofyCeoxOqR2z2S6gi69hvIizXYSovCJ2s/aa hsH9LSzzILzgF7Iv/UaPXVPm31ZeJoYFIqgtbUgGybhY7b23KLPdA2Du3GIZdp699iFU zy/Q== MIME-Version: 1.0 X-Received: by 10.220.163.201 with SMTP id b9mr46600vcy.79.1398805949562; Tue, 29 Apr 2014 14:12:29 -0700 (PDT) Received: by 10.220.174.16 with HTTP; Tue, 29 Apr 2014 14:12:29 -0700 (PDT) Received: by 10.220.174.16 with HTTP; Tue, 29 Apr 2014 14:12:29 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Apr 2014 00:12:29 +0300 Message-ID: Subject: Re: Clear cookies per need From: Shmuel Krakower To: JMeter Users List Content-Type: multipart/alternative; boundary=089e0158ab1abbc4bc04f834e3a2 X-Virus-Checked: Checked by ClamAV on apache.org --089e0158ab1abbc4bc04f834e3a2 Content-Type: text/plain; charset=UTF-8 Sounds like a good idea for my need. I'll update tomorrow. Thanks both! www.beatsoo.org - free application performance monitoring from world wide locations. On Apr 29, 2014 11:26 PM, "Deepak Shetty" wrote: > I would try > In your first http sampler have a pre processor that sets the CookieManager > into variables > vars.putObject("cookiemanager" ,sampler.getCookieManager()); > > Then its available for use in any sampler in that thread - Im not certain > if this has any side effects and as before I agree with what sebb said. > > regards > deepak > > > On Tue, Apr 29, 2014 at 11:14 AM, Shmuel Krakower >wrote: > > > I'll try to explain better tomorrow my use case, but can you think of a > way > > to clear cookies in another way? > > > > www.beatsoo.org - free application performance monitoring from world > wide > > locations. > > On Apr 29, 2014 8:37 PM, "Deepak Shetty" wrote: > > > > > >but I don't want to send an http request to my application in order to > > run > > > this preprocessor, as in real life such requests do not take place. > > > The point sebb is making is that the only time clearing cookies is > > relevant > > > is on the next sampler that makes an HTTP request so you dont need to > > make > > > any additional http requests. > > > so you'd basically have to flag the fact that you need a cookie > > > reset(wherever you are making that determination) and you check that > flag > > > in a pre processor and clear cookies when that happens and then reset > the > > > flag. > > > > > > > > > On Tue, Apr 29, 2014 at 10:31 AM, Shmuel Krakower > > >wrote: > > > > > > > Basically I have a structured script where all of the actual samplers > > are > > > > used by an include controller. > > > > > > > > I need to "sometimes" re-login the thread and for that I use a > > throughput > > > > controller which include the login module, which clear all cookies > like > > > > I've described with a pre processor and execute a new login request. > > > > > > > > I also need to achieve the same cookies drop for anonymous users > > > > "sometimes", but I don't want to send an http request to my > application > > > in > > > > order to run this preprocessor, as in real life such requests do not > > take > > > > place. > > > > > > > > I hope it make sense. > > > > > > > > www.beatsoo.org - free application performance monitoring from world > > > wide > > > > locations. > > > > On Apr 29, 2014 6:45 PM, "sebb" wrote: > > > > > > > > > On 28 April 2014 14:40, Shmuel Krakower > wrote: > > > > > > Hi, > > > > > > I need to clear all cookies on certain cases. > > > > > > For that I use a BSF pre processor with the following code: > > > > > > > > > > > > while(sampler.getCookieManager().getCookieCount() > 0) > > > > > > { > > > > > > sampler.getCookieManager().remove(0); > > > > > > } > > > > > > > > > > > > This works just fine. > > > > > > > > > > > > The thing is that I want to be able to execute this code in other > > > > places > > > > > / > > > > > > cases where I don't trigger an HTTP Request (the > > > > > sampler.getCookieManager() > > > > > > will only work if the BSF is located as a child of an HTTP > > request). > > > > > > > > > > > > Anyone can suggest how can I clear all cookies in another way? > > > > > > > > > > Surely the cookies are only relevant to the HTTP Sampler, so > clearing > > > > > them before the sample should be sufficient? > > > > > > > > > > Why is there a need to clear the cookies any where else? > > > > > > > > > > > Best, > > > > > > > > > > > > Shmuel Krakower. > > > > > > www.Beatsoo.org - re-use your jmeter scripts for application > > > > performance > > > > > > monitoring from worldwide locations for free. > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org > > > > > For additional commands, e-mail: user-help@jmeter.apache.org > > > > > > > > > > > > > > > > > > > > --089e0158ab1abbc4bc04f834e3a2--