Cookies are the simplest way to tell stateful traffic apart from public traffic, and most debugging workflows need to look at one or the other in isolation. The hasAnyCookieOnRequestFilter is a lightweight switch that surfaces every cookie bearing exchange, ready to be combined with tagging, throttling, or header rewriting actions.
Use hasAnyCookieOnRequestFilter whenever a rule should only run on requests that already carry a Cookie header. The filter is evaluated when the request headers arrive from the client, so it is cheap and composes well with header or body actions.
Common scenarios:
Add a tag to every request that arrives with a cookie. Helps when reviewing a long capture to see which calls were authenticated.
rules:
- filter:
typeKind: HasAnyCookieOnRequestFilter
actions:
- typeKind: ApplyTagAction
tag:
value: has-session
Force the client to be treated as anonymous on a chosen API to see how it falls back when the server cannot identify the user.
rules:
- filter:
typeKind: FilterCollection
operation: And
children:
- typeKind: HasAnyCookieOnRequestFilter
- typeKind: HostFilter
pattern: api.example.com
operation: Exact
actions:
- typeKind: DeleteRequestHeaderAction
headerName: cookie
Slow down requests that carry cookies, leaving public asset fetches at full speed, so you can profile session sensitive endpoints.
rules:
- filter:
typeKind: HasAnyCookieOnRequestFilter
actions:
- typeKind: AverageThrottleAction
bandwidthBytesPerSeconds: 65536
Select exchanges having any request cookie
Evaluation scope defines the timing where this filter will be applied.
requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client
hasAnyCookieOnRequestFilter
This filter has no specific characteristic
The following table describes the customizable properties available for this filter:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| inverted | boolean | Negate the filter result | false |
The following examples apply a comment to the filtered exchange
Select exchanges having any request cookie.
rules:
- filter:
typeKind: HasAnyCookieOnRequestFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of HasAnyCookieOnRequestFilter for .NET integration.
The following filters are related to this filter:
No. It only checks whether the request has at least one Cookie header value. If you need to target a named cookie, use hasCookieOnRequestFilter instead.
An empty header is treated as having no cookie value, so the filter will not match it. Most clients omit the header entirely when there is nothing to send.
Yes. Set inverted: true and the filter will match requests that do not carry a Cookie header.