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 6718110E8A for ; Tue, 29 Apr 2014 20:26:34 +0000 (UTC) Received: (qmail 45938 invoked by uid 500); 29 Apr 2014 20:26:32 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 45901 invoked by uid 500); 29 Apr 2014 20:26:32 -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 45891 invoked by uid 99); 29 Apr 2014 20:26:32 -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 20:26:32 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shettyd@gmail.com designates 209.85.212.170 as permitted sender) Received: from [209.85.212.170] (HELO mail-wi0-f170.google.com) (209.85.212.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 20:26:27 +0000 Received: by mail-wi0-f170.google.com with SMTP id bs8so7614169wib.5 for ; Tue, 29 Apr 2014 13:26:05 -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=cLq49LYU0rgDX3XmMuumtEaw5O60KRclqLuUVKOsnW0=; b=R0Gd7hUd+prbyjSkcJmLpYAo2rE3bRx1+cNV46c1Si3Sb/Q6ltgFKGaubdAntAycFl 6peEyY4Nod4pBSBlFX4yeoRO8UT/L4ht7Eft3KcNZCBrOivnK2efjhY42E9i09tcfJ/U PTmxOw5oeIE0QRQMaG5OZFHzi2oGCJgYFkZ/ruzEp4d/+enzB+pPS4rWvLs0R5s1Lkuu DJelV1eKIdKwPzsJVwLqzlGsCkyOjT/U/dS4MFEK5XcS8L536YaeUpmR8u082lETto2Q FnYbZMgE1Bp4hFdDP7wFw5uQIBL2fkhEM9TtQYbABsJb12Upc5wkf4HtglxhTTy/+lOs kJ1Q== MIME-Version: 1.0 X-Received: by 10.180.188.134 with SMTP id ga6mr14754wic.58.1398803165512; Tue, 29 Apr 2014 13:26:05 -0700 (PDT) Received: by 10.194.204.225 with HTTP; Tue, 29 Apr 2014 13:26:05 -0700 (PDT) In-Reply-To: References: Date: Tue, 29 Apr 2014 13:26:05 -0700 Message-ID: Subject: Re: Clear cookies per need From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=001a11c37ea0ca8b4f04f8343dc8 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c37ea0ca8b4f04f8343dc8 Content-Type: text/plain; charset=UTF-8 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 > > > > > > > > > > > > > > --001a11c37ea0ca8b4f04f8343dc8--