After reading the blog post, you refer to the code for the Session and NativeSessionStorage and read the code that I would like to try to simulate the behavior mentioned in the blog post to do this:
$session = $this->get('session'); // Change the session attributes $session->save(); session_write_close(); // Do database calls and other stuff.
I have not tested it, but it should work properly. Another solution to your problem is to use a different session store than NativeSessionStorage , which is the default. You can use, for example, database storage using the PdoSessionStorage object. This may prevent the lock from using PHP. For more information on how to use the database store for sessions, see the cookbook entry .
But there is no guarantee that the database system will not add up multiple queries if they access the same row, but it should be faster than with NativeSessionStorage .
Respectfully,
Matt
source share