Skip to content

Commit 7921c90

Browse files
jderussenicolas-grekas
authored andcommitted
Remove deprecate session service
1 parent 3d47583 commit 7921c90

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

Authentication/Token/Storage/UsageTrackingTokenStorage.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,33 +79,11 @@ public static function getSubscribedServices(): array
7979

8080
private function getSession(): SessionInterface
8181
{
82-
// BC for symfony/security-bundle < 5.3
83-
if ($this->container->has('session')) {
84-
trigger_deprecation('symfony/security-core', '5.3', 'Injecting the "session" in "%s" is deprecated, inject the "request_stack" instead.', __CLASS__);
85-
86-
return $this->container->get('session');
87-
}
88-
8982
return $this->container->get('request_stack')->getSession();
9083
}
9184

9285
private function shouldTrackUsage(): bool
9386
{
94-
if (!$this->enableUsageTracking) {
95-
return false;
96-
}
97-
98-
// BC for symfony/security-bundle < 5.3
99-
if ($this->container->has('session')) {
100-
return true;
101-
}
102-
103-
if (!$this->container->get('request_stack')->getMainRequest()) {
104-
trigger_deprecation('symfony/security-core', '5.3', 'Using "%s" (service ID: "security.token_storage") outside the request-response cycle is deprecated, use the "%s" class (service ID: "security.untracked_token_storage") instead or disable usage tracking using "disableUsageTracking()".', __CLASS__, TokenStorage::class);
105-
106-
return false;
107-
}
108-
109-
return true;
87+
return $this->enableUsageTracking;
11088
}
11189
}

0 commit comments

Comments
 (0)