How does Dynatrace use cookies?


Dynatrace real user monitoring relies on browser cookies to correlate user interactions in the browser (i.e., user actions) with general page and backend performance metrics. Cookies are used to

  • Monitor site performance
  • Analyze website usage
  • Track user behavior

The data stored in cookies is made up of random values, timestamps, and data that are required to correctly identify the applications in your monitored environment. The real user monitoring JavaScript library must be able to set and modify these cookies. This means that Dynatrace cookies don't support the HTTPOnly flag. Cookies must be included with each request so that user actions can be correlated with backend performance. You can use the Secure cookie flag, however this leads to loss of visibility into any unencrypted HTTP communication.

The following table provides an overview of cookie usage in Dynatrace.

Cookie Structure Expires
dtCookie/rxsession* <randomValue> | <encoded application info> session
dtLatC/rxlatency* Measured latency to server session
dtPC/rxpc* <serverID>$<randomValue>_<currentMillis>v<randomValue> session
dtSa <URL-encoded action name**> session
dtBw <status>_<durationMillis> session
rxsession <randomValue> | <application info> session
rxVisitor <timestamp><randomValue> 2 years

* Cookies can be given alternative names. This enables you to simultaneously monitor some applications with Dynatrace OneAgent and others with AppMon instrumentation&all on the same domain.

** The dtSa cookie is used to save user action names, such as Click on Login across different pages. This is required because page loads result in JavaScript code restart and so all contextual information must be stored in cookies.

Session storage

Dynatrace uses sessionStorage to store a backup of rxVisitor and dtCookie/rxsession because certain browsers delete random cookies when too many cookies are used. Dynatrace sets the following two keys (see the table above for examples):

  • rxVisitor
  • dtCookie or rxsession

Local storage

Dynatrace uses localStorage to cache the last monitor beacon response, which contains the configuration for the real user monitoring JavaScript library. It doesn't store any user-related data in localStorage. The following table gives an overview of the key/value pairs that Dynatrace writes to local storage.

Key Example value Description
ruxitagentjs__Store OK(nginx) | name=ruxitagentjs | featureHash=2SVfqr | version= | buildNumber=10119170508093112 | lastModification=1494945232091 Beacon response. Configuration for the JavaScript code.