Doc #63278 [NEW]: Session locking is not described at all
| From: | sven at rtbg dot de | Date: | Sun, 14 Oct 2012 19:41:11 +0000 |
| Subject: | Doc #63278 [NEW]: Session locking is not described at all | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8961@lists.php.net to get a copy of this message | ||
From: sven at rtbg dot de
Operating system: any
PHP version: Irrelevant
Package: Session related
Bug Type: Documentation Problem
Bug description:Session locking is not described at all
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 bug report at https://bugs.php.net/bug.php?id=63278&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63278&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63278&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63278&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63278&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63278&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63278&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63278&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63278&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63278&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63278&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63278&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63278&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63278&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63278&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63278&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63278&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63278&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63278&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63278&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63278&r=mysqlcfg