ID: 22462 Updated by: [EMAIL PROTECTED] Reported By: cmaxwell at themanor dot net -Status: Open +Status: Feedback Bug Type: Session related Operating System: OpenBSD 3.2-stable PHP Version: 4.3.0 New Comment:
What session handler are you using? Previous Comments: ------------------------------------------------------------------------ [2003-02-27 12:06:37] cmaxwell at themanor dot net This is a file locking/blocking issue. While avoiding collision on the session file may be a "feature", the behavior blocking execution and not returning an error is a bug. Run the following script from CLI php on two seperate consoles on the same host. The first script will execute, start the session and, quite obviously, not return. The second script will start, but will never finish the session_start() command, nor will it timeout, until the first process finishes. --------- <?php $sidnum = "fdc69822e43b7d9a1942f8bae9731e18"; session_id($sidnum); print "STARTING SESSION...."; session_start(); print "STARTED"; while (1) {} ?> --------- Some ideas for improved behavior: - accept an optional parameter to session_start() of "$nonblock" that allows returning FALSE on blocking error. This avoids breaking web-based scripts that may rely on the TRUE return code. - new function wrapper session_start_nonblock() that has nonblocking behavior and/or an error return code. Both suggestions leave the onus of how to deal with undefined blocking behavior up to the application. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22462&edit=1