target navigation · lesson 3 of 8 · sources checked 2026-11-20
state across steps
This lesson shows the state that a flow carries from step to step, and which state stays on one exit IP for a run.
purpose
In a flow, each step reads the state that the step before it left, and the last step fails when that state breaks.
Old state after a run can also carry a challenge flag into the next run. A challenge flag is a cookie or a stored value that a site sets after it shows a challenge.
objectives
- List the kinds of state that a flow carries from one step to the next.
- Explain why one run of a flow keeps one sticky session.
- Separate the state to keep inside a run from the state to remove between runs.
- Identify the signal that a change of one bound value gives to a site.
new terms
- flow
- An ordered list of declared steps that a collection system runs on a target, with one success criterion.
- sticky session
- A proxy session that keeps the same exit IP for all requests of one run.
- browser context
- An isolated set of cookies and storage inside one browser process.
- cookie jar
- The cookies of one profile.
- profile
- The stored browser state of one identity: cookies, other stores, cache, and settings.
- profile poison
- A challenge flag or a bad history that stays in a profile and causes later blocks.
- quarantine
- To mark stored results or an identity as not valid without a delete.
- storage partitioning
- A browser rule that keys stored state to the top-level site.
how it works
A site remembers a visitor between two requests with stored state. The operator must know where this state is, because each step of a flow reads the state of the step before it.
A flow carries these kinds of state:
| state | where it is | example |
|---|---|---|
| Cookies | The cookie store of the browser | A web session cookie after the first page |
| Storage | localStorage and the other stores of the page | A saved filter |
| Consent | A cookie or a store that a consent banner writes | The choice "accept" or "reject" |
| Cart | A web session on the server, keyed by a cookie | One item after an add step |
| URL state | The address and the history of the page | A page number in the query |
| Client values | The exit IP, the TLS stack, and the user agent | One exit IP for each step |
MDN names the management of a web session as one use of cookies, for example a sign-in status or a cart MDN, source 1.
A consent banner also writes state. The Transparency and Consent Framework of IAB Europe lets a user give or refuse consent, and a consent tool records the choice IAB Europe, source 2. With no stored choice, the site shows the banner again.
state that stays inside a run
A cart is a record on the server. The site finds it with a cookie. Some sites tie the cart to the exit IP. Thus my rule is one sticky session for each run.
example A run adds an item to the cart at step 3 from exit IP A. Step 5 opens the cart from exit IP B. The site does not accept the cookie from the new address, and the cart is empty.
I rotate the exit IP only between runs, never inside one run. One run of a flow is one attempt.
bound values
A defender can apply session binding. Then a token or a clearance cookie is valid only with the client values at the time of the challenge pass. These values can be the exit IP, the TLS stack, the user agent, and the device. A change of one value makes the token fail.
example The site sets the cookie for exit IP A and browser X. The same cookie from exit IP B gets a new challenge.
claim of a company Two companies state what their clearance token holds or binds to:
- Cloudflare: the
cf_clearancecookie belongs only to the visitor and the device that got it, and this stops its reuse on a different machine Cloudflare, source 3. - Amazon Web Services: the token is in a cookie named
aws-waf-token. It holds the time of the last challenge pass and client signals Amazon Web Services, source 4.
state that resets between runs
status of this section: documented in my test systemEach attempt on the benchmark platform, my test system, starts with no old state.
The platform starts each attempt in a new browser context. Thus no cookie, store, or consent choice of an earlier attempt gets into the next attempt.
Old state is a risk. A challenge flag can stay in the cookie jar after a CAPTCHA, and the next run sends it again.
example A run gets a CAPTCHA and stops. The next run uses the same profile, and the site blocks its first query. This is profile poison.
The correction is to quarantine the profile, not to try it again. Then the next attempt starts in a new browser context.
A browser can also split stored state by site. MDN states that Firefox applies storage partitioning: it stores the state of an embedded resource separately for each top-level site MDN, source 5. An embedded resource is a part from a different site inside the page, for example a widget. The top-level site is the site in the address bar.
example One chat widget is in shop A and in shop B. In shop A, the widget sets a cookie. In shop B, the widget does not get that cookie.
In such a browser, a flow cannot carry the state of a widget from one site to the next site.
url state
A single-page app can change the address with no new page load. Some apps keep the page number only in memory, not in the address. Then a reload loses it.
MDN states that the browser does not load the new URL after a call to pushState() MDN, source 6.
example A search app shows result page 3 at the address ?page=3. A reload gives page 1, because the app read the page number from its memory, not from the address.
A reload is also a signal to the site. A site can count the reloads of one page in a short time, and stop a client that reloads too soon.
example A client reloads a slow page three times in ten seconds, because one element is late. The site counts three reloads, and the next request gets a block page.
the two sides
| automation side | detection side |
|---|---|
| Rotation occurs between attempts, not inside one. A reused profile carries old challenge flags into the next run. A reload can lose the state of a single-page app. | A web session cookie can bind the visit to one IP address, one TLS stack, one user agent, and one device. A change of one of them is a signal. A site can count the reloads of a slow page, and stop a client that reloads too soon. |
design decisions
| option | gain | cost | when it is correct |
|---|---|---|---|
| One sticky session for each run | The cart and the web session stay valid for each step. | One bad exit IP stops the full run. | Flows with a cart, a sign-in, or a form over many pages |
| Rotate the exit IP inside a run | Each request can use a fresh address. | Bound tokens fail, and the cart can be empty at the end. | Only for single requests with no state between them |
| A new browser context for each attempt | No old flag gets into the next attempt. | Each attempt starts with no consent choice and no clearance. | Measurements and tests that compare attempts |
| Reuse one profile across runs | The site sees a known visitor with history. | One challenge flag poisons each later run. | Only with a health check and a quarantine rule for each profile |
diagram
the state that a flow carries: what stays inside a run and what resets between runs
- Exit IP (sticky session)Stays for the run. Changes only between runs.
- Clearance tokenStays for the run. Valid only with the same client values.
- Web session cookie and cartStays for the run. The last step reads the cart.
- Consent choiceResets between runs, in a new browser context.
- Stores of the pageResets between runs, in a new browser context.
- URL stateDepends on the app: in the address, or only in the memory of the page.
failure modes
| problem | cause | correction |
|---|---|---|
| The cart is empty at the last step. | The exit IP changed inside the run, and the site tied the cart to the first address. | Keep one sticky session for the full run. Rotate only between runs. |
| The site blocks the first query of the next run. | A challenge flag stayed in the cookie jar of a reused profile. | Quarantine the profile. Start the next attempt in a new browser context. |
| A valid clearance cookie fails on a later step. | One bound value changed, for example the TLS stack or the user agent. | Record the client values with each token. Compare them when a token fails. |
| A reload shows page 1 in place of page 3. | The single-page app kept the page number only in its memory. | Read the state from the address and the requests, not from a reload. |
| A reload loop starts on a slow page. | The client acts before the page is ready, and the site counts each reload. | Check for a block first. Never reload a loaded page for a late element. |
check questions
List four kinds of state that a flow carries from one step to the next.
sample answer
Cookies, the stores of the page, the consent choice, the cart, the URL state, and the client values such as the exit IP. Any four of these are correct.
Explain why one run of a flow with a cart keeps one sticky session.
sample answer
Some sites tie the cart and the web session to the exit IP that made them. If the exit IP changes inside the run, the site does not accept the cookie, and the cart is empty at the last step.
A run got a CAPTCHA and stopped. Which action is correct before the next run?
- Use the same profile again, because it has history
- Quarantine the profile and start the next attempt in a new browser context
- Change the exit IP and keep the same cookie jar
answer
b. Quarantine the profile and start the next attempt in a new browser context
The challenge flag stays in the cookie jar of the profile. A reused profile carries the flag into the next run, and the site can block its first query.
A clearance cookie is bound to the exit IP, the TLS stack, and the user agent. The next request has the same cookie and a different user agent. What does the site see?
- A change of one bound value, which is a signal
- A valid token, because the cookie did not change
- Nothing, because a site cannot read the user agent
answer
a. A change of one bound value, which is a signal
With session binding, a token is valid only with the client values at the time of the challenge pass. A change of one value makes the token fail, and the site can show a new challenge.
exercise
exercise Do this task in your own lab, with a shop page that you run and synthetic data only. Do not send a request to a site of a third party.
Your lab shop must set these values:
- A web session cookie
- A cart cookie
- A consent choice
- One stored value in
localStorage
- Make a flow of five steps on your lab shop: home, search, item, add to cart, cart.
- Open the Cookies pane of the browser developer tools.
- Run the flow one time in a new browser context.
- Record each cookie and each store value after each step.
- Mark each value as "keep for the run" or "remove before the next run".
- Run the flow again in the same context, and record the values that stay from the first run.
sample answer
The answer uses a synthetic lab shop.
The web session cookie and the cart cookie are "keep for the run". The cart step fails without them. The consent choice and the stored value are "remove before the next run", because each attempt must start with the same state. In the second run, the old web session cookie, the consent choice, and the stored value stay. Thus the second run does not start from the same state as the first run. A new browser context for each attempt removes this difference.
sources
- Using HTTP cookies, MDN, documentation, read 2026-11-20
- Transparency and Consent Framework, IAB Europe, documentation, read 2026-11-20
- Turnstile pre-clearance, Cloudflare, documentation, read 2026-11-20
- Token details, Amazon Web Services, documentation, read 2026-11-20
- State Partitioning, MDN, documentation, read 2026-11-20
- History: pushState() method, MDN, documentation, read 2026-11-20
- My model of the state of a flow and of the rule to rotate only between runs, 2026-11 (not public).
- Benchmark platform, design (my test system): a new browser context for each attempt, 2026-11 (not public).