My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Is it good practice to do session_write_close() to allow another requests getting served?

Ankur Raiyani's photo
Ankur Raiyani
·Mar 23, 2018

My app is in Magento 2 and performing some long tasks from magento to shell. So in script execution time server is not serving to any other requests of that particular session until that task is getting finished and request completes. So i found that problem is with session lock and found solutions on php forums that using session_write_close() i can allow another requests of same session to perform their tasks.

But i don't know is it safe to do session_write_close().

NOTE: I don't need to write anything in session after closing it.