Yes, I did see the problem happen.
This code change will force the session information to be committed to the servers memory.
In some cases, the session changes are not committed to memory when the header() function is used to redirect the page. This change will force the session changes to be remembered by the server.