Lets suppose you have made a data crawling application and you are using sessions in it. Now you want the user to keep going through other sections of the application while you have clicked on the “Run Crawler” link and open it in a new window. Now what will happen is the other pages will be locked as long as your long script runs.

The reason is quite simple , the session will lock session access from other pages untill the script ends and the final session data is written. This is where the session_write_close() comes in real handy , once you have used the session as you want on top of the lengthy script , call session_write_close() , this will finalize the session for that page and allow other pages from the same site and session to be free to use it again.

Hope it helps someone!