8000 [HttpFoundation] fix session tracking counter · symfony/symfony@26fc4e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 26fc4e6

Browse files
[HttpFoundation] fix session tracking counter
1 parent c36f8cb commit 26fc4e6

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/Symfony/Component/HttpFoundation/Session/Session.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ public function getUsageIndex()
160160
*/
161161
public function isEmpty()
162162
{
163-
++$this->usageIndex;
163+
if ($this->isStarted()) {
164+
++$this->usageIndex;
165+
}
164166
foreach ($this->data as &$data) {
165167
if (!empty($data)) {
166168
return false;
@@ -185,8 +187,6 @@ public function invalidate($lifetime = null)
185187
*/
186188
public function migrate($destroy = false, $lifetime = null)
187189
{
188-
++$this->usageIndex;
189-
190190
return $this->storage->regenerate($destroy, $lifetime);
191191
}
192192

@@ -195,8 +195,6 @@ public function migrate($destroy = false, $lifetime = null)
195195
*/
196196
public function save()
197197
{
198-
++$this->usageIndex;
199-
200198
$this->storage->save();
201199
}
202200

src/Symfony/Component/HttpFoundation/Session/SessionBagProxy.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public function getBag()
4444
*/
4545
public function isEmpty()
4646
{
47-
++$this->usageIndex;
48-
4947
return empty($this->data[$this->bag->getStorageKey()]);
5048
}
5149

@@ -81,8 +79,6 @@ public function getStorageKey()
8179
*/
8280
public function clear()
8381
{
84-
++$this->usageIndex;
85-
8682
return $this->bag->clear();
8783
}
8884
}

0 commit comments

Comments
 (0)
0