Skip to content

Session protection ​

Symptoms of session protection: binding sessions to the client, mismatches, and attribution of events to users.

Many session.hijack events for normal users ​

  • Cause: users change networks beyond the bound prefix (mobile carriers, VPNs, corporate proxies with several exits). A fleet of browsers behind a TLS-terminating proxy changes its TLS stack. Or user agents are rewritten by an extension or proxy.
  • Check: the Mismatches view under Session protection (or waap sessions mismatches -app NAME) shows which factor differs most. The event's message lists the factors that differed, matched and were not compared.
  • Fix: widen the network (bind.ipv4_prefix=8, bind.ipv6_prefix=32), or turn the factor off (bind.network=false, bind.tls_fingerprint=false). Keep on_mismatch=log until the view is quiet, and add an exception (session.*) for known clients.

Users are logged out after turning on session protection ​

  • Cause: on_mismatch=end with the mismatches described above. The grace time passed while users still had sessions without a binding (session.unbound, factor binding). A client does not keep the __waap_sb cookie (some API clients, or a proxy that drops cookies). Or a session was idle longer than key rotation times keys kept.
  • Check: events with rule session.* and their factors; waap sessions get -app NAME (grace_until, keys.*).
  • Fix: set on_mismatch=log while investigating; set grace_until=168h; add an exception for the client's paths; raise keys.keep.
  • Cause: no session cookie is named (cookies is empty, or the name does not match: remember_* does not match remember). There is no session key yet; the active node makes one within about 10 seconds, and inspection loads it within 2 more. The upstream did not set the cookie in this answer and the request had none. Or enabled=false.
  • Check: the trace's sessions step on the answer (set-cookie __waap_sb: session ... bound); waap sessions keys list -app NAME.
  • Cause: names starting with waap_ or __waap_ are reserved for the product. They are removed from every request before it reaches the upstream; the trace shows cookie: ... removed (the product's own) in the pipeline step.
  • Fix: rename the application's cookie.

Events do not show the user ​

  • Cause: attribution=off. Or no login endpoint is set under bots.login, or its path, method or username field does not match the login request (form: needs a form body, json: needs a JSON body under 64 KiB). Or the login answer counted as failed (status 400 or above, a failure_status, or a redirect to failure_location). Or the session was bound before the login, and the application did not answer the login with a session cookie or a successful status.
  • Check: waap bots get -app NAME (logins); the login request's trace (the binding note names the user).