Skip to content

Commit a0acf05

Browse files
author
Jacob Bare
authored
Remove direct call to session_write_close()
Instead, retrieve the Symfony session and save it (if present). This will properly close the session.
1 parent a6e8a02 commit a0acf05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Task/TaskManager.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ public function isEnabled()
174174
public function execute(PostResponseEvent $event)
175175
{
176176
if ($this->isEnabled() && $this->masterRequest) {
177-
session_write_close();
177+
$session = $event->getRequest()->getSession();
178+
if (null !== $session) {
179+
// Saves the session, which calls PHP's session_write_close()
180+
$session->save();
181+
}
178182

179183
// Allow any loaded plugins to fire
180184
foreach ($this->getPlugins() as $plugin) {

0 commit comments

Comments
 (0)