By default, Matomo stores the activated variation name in the Local Storage if the browser supports this feature. If the browser does not support this, Matomo sets a cookie for up to one year to remember which variation was once selected for this particular visitor.

Previous FAQ: How is a variation assigned in a Matomo A/B test, and does it require a server request?