php - Where to use session_write_close(), in ajax
My problem is that while an ajax request is going on, the user might click 'contact us' or some other link, but the session is locked, from the ajax, and the user has to wait for that, before being served the next link.
main url: makes ajax call, displays data ajax target: looks at $_SESSION for various reasons, calls an api (this will take 5 seconds), makes changes to $_SESSION, returns some values
During that 5 seconds, user clicks 'contact us'
onclick: ajax is aborted, by jquery. I dont care, anymore, what the ajax target did. Any changes to SESSION dont matter much, either way. user has to wait the 5 seconds, then the contact page loads.
Where is the proper place to use session_write_close()? Is it even possible, in this situation? (given that I have to write to SESSION, under normal circumstances)