note 93670 added to function.session-start
| From: | Charlie at NOSPAM dot example dot com | Date: | Tue, 22 Sep 2009 13:52:45 +0000 |
| Subject: | note 93670 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160921@lists.php.net to get a copy of this message | ||
As noted before, if you have multiple concurrent requests from same session, they will serialize
based upon session_start()-end of script--unless you call session_write_close.
Practically speaking this is not usually an issue and using a single global lock over all session
use in a script is arguably the simplest effective mechanism. But be warned that depending on end
of script to close the session *will serialize concurrent session requests*. Background "data
retrieval" (e.g. AJAX or amfphp/Flex) can fall into this trap easily.
Holding the session_write_close until after an expensive operation is likewise problematic.
To minimize effects, call session_write_close (aka session_commit) as early as practical (e.g.
without introducing race conditions) -- often this possible quite early in the script or otherwise
avoid the serialization bottleneck.
----
Server IP: 209.41.74.194
Probable Submitter: 70.132.10.21
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- https://master.php.net/note/edit/93670
Del: integrated -- https://master.php.net/note/delete/93670/integrated
Del: useless -- https://master.php.net/note/delete/93670/useless
Del: bad code -- https://master.php.net/note/delete/93670/bad+code
Del: spam -- https://master.php.net/note/delete/93670/spam
Del: non-english -- https://master.php.net/note/delete/93670/non-english
Del: in docs -- https://master.php.net/note/delete/93670/in+docs
Del: other reasons-- https://master.php.net/note/delete/93670
Reject -- https://master.php.net/note/reject/93670
Search -- https://master.php.net/manage/user-notes.php