Doc #63278 [Opn->Dup]: Session locking is not described at all

From: Date: Wed, 16 Jan 2013 19:26:32 +0000
Subject: Doc #63278 [Opn->Dup]: Session locking is not described at all
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9434@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63278&edit=1 ID: 63278 Updated by: googleguy@php.net Reported by: sven at rtbg dot de Summary: Session locking is not described at all -Status: Open +Status: Duplicate Type: Documentation Problem Package: Session related Operating System: any PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Dup bug #55624 Previous Comments: ------------------------------------------------------------------------ [2012-10-14 19:41:11] sven at rtbg dot de Description: ------------ --- From manual page: http://www.php.net/function.session-set-save-handler --- Session locking is not described at all. The callbacks for "open" and "close" must aquire a write lock on the ressource that stores the session data. If this is not done, race conditions will destroy the data. The internal files handler gets it right. The Example #2, which reimplements this handler, gets it wrong! I don't know about any other internal save handler, like sqlite or memcached. This one is a duplicate of Bug #55624, but with better explanation and more code. :) Test script: --------------- Please see http://pastebin.com/EbqigxmY Expected result: ---------------- When running the script from http://pastebin.com/EbqigxmY the expected behaviour is that all three iframes get filled one after another, with 1 second break between each. The last response should list all three subrequests and the master request in the var_dump(). Actual result: -------------- Using the example #2 code, all iframes get filled after 1 second, and all of them only report the master request and its own subrequest in the dump. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63278&edit=1

« previous php.doc.bugs (#9434) next »