Skip to content

Commit e50b0a6

Browse files
Merge branch '4.4' into 5.0
* 4.4: [PropertyAccess] fix tests [WebProfilerBundle] fix test remove assertions that can never be reached [PropertyAccess] Improve message of unitialized property in php 7.4 [HttpFoundation] Fixed session migration with custom cookie lifetime [HttpKernel][FrameworkBundle] fix compat with Debug component [Serializer] Remove unused variable Allow URL-encoded special characters in basic auth part of URLs [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key [Validator] Add missing Ukrainian and Russian translations Track session usage when setting the token [4.4][MonologBridge] Fix $level type No need to reconnect the bags to the session Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular [Security][Http][SwitchUserListener] Ignore all non existent username protection errors Add installation and minimal example to README
2 parents 2047b7e + 9631d44 commit e50b0a6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Authentication/Token/Storage/TokenStorage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ public function getToken()
4545
*/
4646
public function setToken(TokenInterface $token = null)
4747
{
48+
if ($token) {
49+
// ensure any initializer is called
50+
$this->getToken();
51+
}
52+
4853
$this->initializer = null;
4954
$this->token = $token;
5055
}

Authentication/Token/Storage/UsageTrackingTokenStorage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public function getToken(): ?TokenInterface
5252
public function setToken(TokenInterface $token = null): void
5353
{
5454
$this->storage->setToken($token);
55+
56+
if ($token && $this->enableUsageTracking) {
57+
// increments the internal session usage index
58+
$this->sessionLocator->get('session')->getMetadataBag();
59+
}
5560
}
5661

5762
public function enableUsageTracking(): void

0 commit comments

Comments
 (0)