[HttpFoundation] fix session tracking counter
This commit is contained in:
parent
c36f8cb21b
commit
26fc4e683f
@ -160,7 +160,9 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
public function isEmpty()
|
public function isEmpty()
|
||||||
{
|
{
|
||||||
|
if ($this->isStarted()) {
|
||||||
++$this->usageIndex;
|
++$this->usageIndex;
|
||||||
|
}
|
||||||
foreach ($this->data as &$data) {
|
foreach ($this->data as &$data) {
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
return false;
|
return false;
|
||||||
@ -185,8 +187,6 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
public function migrate($destroy = false, $lifetime = null)
|
public function migrate($destroy = false, $lifetime = null)
|
||||||
{
|
{
|
||||||
++$this->usageIndex;
|
|
||||||
|
|
||||||
return $this->storage->regenerate($destroy, $lifetime);
|
return $this->storage->regenerate($destroy, $lifetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +195,6 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
++$this->usageIndex;
|
|
||||||
|
|
||||||
$this->storage->save();
|
$this->storage->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@ final class SessionBagProxy implements SessionBagInterface
|
|||||||
*/
|
*/
|
||||||
public function isEmpty()
|
public function isEmpty()
|
||||||
{
|
{
|
||||||
++$this->usageIndex;
|
|
||||||
|
|
||||||
return empty($this->data[$this->bag->getStorageKey()]);
|
return empty($this->data[$this->bag->getStorageKey()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,8 +79,6 @@ final class SessionBagProxy implements SessionBagInterface
|
|||||||
*/
|
*/
|
||||||
public function clear()
|
public function clear()
|
||||||
{
|
{
|
||||||
++$this->usageIndex;
|
|
||||||
|
|
||||||
return $this->bag->clear();
|
return $this->bag->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user