How to Block Cookies in Charles Proxy

How To Block Cookies in Charles Proxy

Introduction

In Charles Proxy, the Block Cookies tool helps you block your browser from sending or receiving cookies, allowing you to test websites as if cookies are disabled. However, setting it up can be time-consuming. You first need to configure the proxy settings, ensure the SSL certificate is installed, and then manually set up rules to block cookies. While these steps are effective, they add complexity and require multiple steps before you can even start testing.

Now, imagine achieving the same result with just two clicks. Requestly’s Chrome extension offers a simplified solution, allowing you to block cookies directly from your browser without the need for intricate setup. No proxy configuration or SSL .

Charles Proxy’s Block Cookies Tool: How It Works

The block Cookies tool removes the Cookie header from requests, which prevents the client application from sending the cookie value to the remote server. The Set-Cookie header is also removed from responses, preventing the client application from receiving requests to set cookies from the remote server.

How to Configure Charles Proxy’s Block Cookies Tool

      1. Open Charles Proxy and ensure that your proxy is enabled and traffic is being captured.
      2. Navigate to the Tools Menu:

        • In the top menu, click on Tools.
        • From the dropdown, select Block cookies.

Block Cookies in charles menu
  1. This will open the Block Cookie settings window here check Enable Block Cookie box to block cookies on all the sites. You can also block cookies for specific locations by enabling selected location.

Block Cookies Settings

  1. Now click on add to add a new URL, we will use setcookie.net to test the tool, you can select a location based on:

    • Protocol: Here you can select your site’s protocol HTTP or HTTS
    • Host: Here you can enter the host/domain that you want to apply the rule to.
    • Port: You can specify the port on which your site is running.
    • Path: Define the path if you want the rule to apply only to specific paths on the host.
    • Query: here you can define the query parameters that should be targeted.
Block Cookies Location setting

  1. Now Save the rule by clicking OK.

Block Cookies Settings after location setup

  1. After saving this you should be able to see the rule and its modifications
  2. Now visit the site you selected and you can see the URL change.
While Charles Proxy’s Block Cookie tool is highly useful during development, it’s setup can be complicated, and time consuming . Users often need to navigate through the Charles Settings, and define conditions to ensure accuracy. Additionally, as Charles is a desktop application, switching between your testing environment and the proxy can be cumbersome.
Requestly, can make this process much simpler and smoother, saving you time and effort by making it easier to manage everything in one place.
 
You can use the Modify header rule to replicate same functionality in Requestly
 

Modify Header rule in requestly

Say goodbye to complex setups with Charles Proxy and streamline your debugging workflow using Requestly’s Modify Header Request rule. While Charles Proxy requires multiple steps and a separate desktop application to block the cookie, Requestly offers a faster, more intuitive solution directly within your browser. Easily simulate different devices or test API requests with just a few clicks—no need to switch between applications or configure complex rules.

Disable Cookie Requestly config
Overview of Configuration Options
  1. Source Condition: This determines which requests will be redirected.
  2. Type of Header: Select the type of header you want to modify, you can add separate modifications to both
  3. Header Value: Enter the header you want to remove.
  4. Action: The type of modification you want to do to the header
  5. Add Modification: Include additional header modifications.

Steps to Configure Requestly’s Modify Header Rule

  1. Install Requestly Extension: Download and install Requestly’s browser extension.
  2. Open Requestly Dashboard: Visit app.requestly.io and log in.
  3. Click on the Rules tab and then select New Rule.
  4. Choose Modify Header as the rule type.
  5. Enter the URL or URL pattern in the Source Condition field.
  6. Specify the header you want to modifyadd, or remove.
  7. Name your rule and click Save.

Now you can test it on your desired website, or if you do not want to go through the hassle of setting it up yourself, we have created a shared list of this rule for disabling cache for you. Go ahead and import it by clicking this button below 

Or create your own Rule by following the setups below

Interactive guide

Check out this interactive and easy explanation of how to create this rule :

Other Use Cases for Requestly’s Modify Header Rule

Here are some key use cases for the Modify Header rule in Requestly:

  • Bypass CORS : Bypass CORS restrictions during development and testing. Add or modify the Access-Control-Allow-Origin header to test API requests from different domains, even when the server does not explicitly allow cross-origin requests.
  • Test Authentication Mechanisms: Modify headers such as Authorization to simulate being authenticated as different users or roles during testing. This is especially useful for testing API endpoints with various user permissions.
  • Security Testing: Block outgoing requests to simulate how your application behaves when certain endpoints are unreachable, helping to test error handling and fallback mechanisms.
  • Dependency Isolation: Block requests to third-party services to test how your application functions when external dependencies are unavailable.

Migrate from Charles proxy

If you already have a Charles Proxy setup and want to give Requestly a try, You can import these tool settings in Requestly in just few clicks

Requestly currently supports following tools that you can import from Charles Proxy:

  • Rewrite
  • Map Local
  • Map Remote
  • No Caching
  • Block lists
  • Block Cookies

Steps to import

  1. In Charles Proxy, go to the top menu bar and select Tools > Import/Export Settings.

Charles proxy menu Import Export settings
  1. In the popup window that appears, switch to the Export tab. Under the Tools section, select the tools you want to export and click the Export button at the bottom right.

Import Export Setting popup
  1. Open the Requestly dashboard. If you don’t have any existing rules, you’ll see an Import settings from Charles Proxy .
Import from Charles proxy in requeslty dashboard
  1. Upload or drag your exported Charles .xml file into Requestly.
Import charles proxy settings poip up
  1. Once the import is successful, your Charles Proxy settings will be converted into Requestly rules.

Conclusion

I hope this article has given you a clear understanding of both the Block Cookie tool in Charles Proxy and how Requestly can achieve the same results with greater ease. While Charles Proxy effectively handles the task, Requestly offers a more streamlined and efficient experience. Since Requestly operates directly from your browser and leverages built-in browser APIs, there’s no need for complex SSL configurations, eliminating the SSL issues often encountered with Charles Proxy. Plus, you don’t need to switch between different tools—everything you need is right in your browser. Requestly’s exceptional support is reflected in its 4.4 ⭐ rating from over 1,200 users on the Chrome Web Store, proving it’s a great product with top-tier support.

Explore More

Share this article:

Subscribe to our weekly newsletter !

Join 10k developers and QAs to get weekly updates with Requestly's newsletter.​

This article was written by:

Picture of Dinesh Thakur

Dinesh Thakur

Dinesh Thakur, fascinated by technology since childhood, has mastered programming through dedication. Whether working solo or in a team, he thrives on challenges, crafting innovative solutions.

Join 10k developers and get weekly updates with Requestly's newsletter.

Contents

Related posts