From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4.0.5
PHP Bug Type:     Session related
Bug description:  Calling of session write handler after output buffer sent is stupid!

I am experiencing the effects of bug #12968 too. However, it's not really a
bug (as in there is something malfunctioning), but rather a BIG design
flaw. The whole thing centres around the behaviour mentioned in the manual
for the function session_set_save_handler():

"The 'write' handler is not executed until after the output stream is
closed."

Because the output buffer is sent before the write handler is called, when
the client browser is on a fast network connection (i.e. an internal LAN in
my case too) it recieves the output and acts upon the 302 redirect HTTP
header before the write handler has finished executing. However, in this
case, because we are using MySQL, the session write handler function takes
some time - especially so when your MySQL database is on a seperate host to
the web server. This results in the page which is being re-directed to
executing in it's entirity (including the session read/write handlers)
before the original session write function finishes.

This is a MAJOR design flaw (nothing should ever rely upon the speed of a
client connection), and I move that this behaviour be changed immediately.
The session write handler should be called before the output buffer is
sent, but still only after the script has finished executing.
-- 
Edit bug report at: http://bugs.php.net/?id=13300&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to