Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a15a3a

Browse files
committed
merged branch fabpot/session-regenerate-fix (PR #8270)
This PR was merged into the 2.2 branch. Discussion ---------- [HttpFoundation] fixed issue with session_regenerate_id (closes #7380) | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7380 | License | MIT | Doc PR | n/a Commits ------- 77f2aa8 [HttpFoundation] fixed issue with session_regenerate_id (closes #7380)
2 parents ed3bcb0 + 77f2aa8 commit 6a15a3a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,15 @@ public function regenerate($destroy = false, $lifetime = null)
205205
$this->metadataBag->stampNew();
206206
}
207207

208-
return session_regenerate_id($destroy);
208+
$ret = session_regenerate_id($destroy);
209+
210+
// workaround for https://bugs.php.net/bug.php?id=61470 as suggested by David Grudl
211+
session_write_close();
212+
$backup = $_SESSION;
213+
session_start();
214+
$_SESSION = $backup;
215+
216+
return $ret;
209217
}
210218

211219
/**

0 commit comments

Comments
 (0)