19 files declare their use of AnonymousUserSession

ActiveLinkResponseFilterTest.php in core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php
AnnounceBlockTest.php in core/modules/announcements_feed/tests/src/FunctionalJavascript/AnnounceBlockTest.php
AnonymousUserSessionTest.php in core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php
CommentFieldAccessTest.php in core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
CommentItem.php in core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
CommentLinksTest.php in core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
CommentUserNameTest.php in core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
Cron.php in core/lib/Drupal/Core/Cron.php
DisplayPageTest.php in core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php
EntityAccessControlHandlerTest.php in core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
FakeLogEntries.php in core/modules/dblog/tests/src/Functional/FakeLogEntries.php
FilterAPITest.php in core/modules/filter/tests/src/Kernel/FilterAPITest.php
FormCacheTest.php in core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
HandlerFilterCurrentUserTest.php in core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php
MenuLinkTreeTest.php in core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
UiHelperTrait.php in core/tests/Drupal/Tests/UiHelperTrait.php
UpdateKernel.php in core/lib/Drupal/Core/Update/UpdateKernel.php
user.module in core/modules/user/user.module
Enables the user registration and login system.
WorkspaceIntegrationTest.php in core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.