Page 1 of 1

session_write_close and session_readonly

Posted: Mon Sep 17, 2007 12:54 pm
by mauricebis
Hi!

The php documentation is a bit poor about session_write_close and session_readonly and I could do with a bit of "expert help":

Q1) Is session_write_close SYNCHRONOUS that is when we execute the instruction that follows the call, we know that the session variables have been written and the lock (acquired on session_start) has been released or is it ASYNCHRONOUS, as I guess it is, in which case there is apparently no way to know when the writing is done?

Q2) Does session_readonly bypass the lock protocol or does it acquire a read lock permitting several session_readonly to proceed in parallel? If session_write_close is asynchronous and session_readonly bypass locking, it appears difficult to use session_readonly in a read-script after a write-script making use of session_write_close has been called without getting exposed to a race condition whereby we attempt to read the session variables before they are written?

Thanks.

Posted: Mon Sep 17, 2007 1:59 pm
by feyd
Question one can be tested by yourself as can question two. Have you tested these?