Burp Suite User Forum

Create new post

How to update and remove cookies through Burp API

Michael | Last updated: Apr 09, 2019 10:40PM UTC

I only saw get methods for cookies, there's no set or remove methods.

PortSwigger Agent | Last updated: Apr 10, 2019 01:07PM UTC

You can use callback.updateCookieJar to update a cookie. The method takes an ICookie object. If the getValue() method on that object returns null, the cookie is removed.

Burp User | Last updated: Apr 17, 2019 06:21PM UTC

Right but how do you set the value of a existing cookie in the cookie jar? for example if I want to set the cookie value to null? Doesn't seem like there's a way to do it.

PortSwigger Agent | Last updated: Apr 18, 2019 09:29AM UTC

You can set a value using the callback.updateCookieJar method. If you set the value to null it will delete the cookie. We've made a Gist for you that demonstrates this: - https://gist.github.com/pajswigger/1d528a8745c7427adabd5cd1eb21cb56

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.