Sessions settings

The Sessions settings enable you to configure Burp Suite's session handling functionality. You can configure the following:

Session handling overview

When testing web applications, you may encounter challenges relating to session handling and application state. For example:

Burp's session handling functionality enables you to configure the system to handle session-related challenges in the background, helping you to continue your testing uninterrupted.

Session handling rules

Burp's session handling rules give you fine-grained control over how Burp deals with a target's session handling mechanism and related functionality.

Each rule has two parts:

Every time Burp makes an outgoing request, it determines which of the defined rules should apply to the request and then performs all of the relevant actions in order.

Note

Burp Scanner automatically handles sessions during crawling and crawl-driven auditing. Burp does not apply session handling rules to requests made by these scans, except for rules that only contain Set a specific cookie or parameter value and / or Invoke a Burp extension actions.

By creating multiple rules, you can define a hierarchy of behavior that Burp applies to different applications and functions.

For example, you could define the following rules for a particular test:

More information

For more details on configuring session handling rules, see the Session handling rule editor documentation.

Session handling tracer

The session handling tracer can help you when troubleshooting your session handling configuration. To view the tracer, click Open sessions tracer.

The tracer shows a listing of every request that has been handled by the session handling functionality (that is, those requests where at least one session rule has been applied). For each request handled, the tracer shows the sequence of rules and actions that were carried out. It also shows the changes made to the current request at each step in the sequence. This information can help you to see whether your current rule configuration is achieving the required results.

Note

The session handling tracer imposes a processing and storage overhead on all affected HTTP requests. We recommend that you only use the tracer when troubleshooting issues with session handling rules.

Session handling rules in Burp's tools

Burp's session handling rules interact with Burp's other functionality:

The Session handling rules settings are project settings. They apply to the current project only.

Burp's cookie jar stores all of the cookies issued by websites you visit. The cookie jar is shared between all of Burp's tools.

Session handling rules and macros can use the cookie jar to automatically update outgoing requests with cookies.

By default, the cookie jar is updated based on traffic from the Proxy. However, you can configure the cookie jar to monitor any of the following tools to update cookies:

In the case of the Proxy, Burp also inspects incoming requests from the browser. This is useful where an application has set a persistent cookie that is present in Burp's browser that is required to handle your session. Having Burp update its cookie jar based on requests through the Proxy means that all the necessary cookies are added to the cookie jar even if the application does not update the value of the cookie during your visit.

The cookie jar honors the domain and path scope of cookies.

Note

Crawls do not update the cookies stored in the cookie jar.

Managing the cookie jar

To manage the contents of the cookie jar, click Open cookie jar. You can edit cookies manually, remove cookies from the jar, or empty the jar altogether.

The Cookie jar settings are project settings. They apply to the current project only.

Macros

The Macros settings enable you to create and manage macros that Burp can use during testing.

A macro is a predefined sequence of one or more requests. You can use macros within session handling rules to perform various tasks, such as:

As well as a sequence of requests, each macro specifies how cookies and parameters in the sequence should be handled, and any interdependencies between items.

You can add a new macro by clicking Add to display the Macro Editor dialog.

You can also edit your existing macros, or change their position in the list.

More information

For more details on recording macros, see the Macro Editor help.

The Macros settings are project settings. They apply to the current project only.