Add a note about how the files session backend locks session files.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@331493 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Harvey 2013-09-25 21:00:54 +00:00
parent d443751d6a
commit 71ee784aed

View file

@ -88,6 +88,24 @@ unset($_SESSION['count']);
register_globals will overwrite variables in the global scope whose names are shared with session variables. Please see <link linkend="security.globals">Using Register Globals</link> for details.
</para>
</warning>
<note>
<para>
File based sessions (the default in PHP) lock the session file once a
session is opened via <function>session_start</function> or implicitly via
<link linkend="ini.session.auto-start">session.auto_start</link>. Once
locked, no other script can access the same session file until it has been
closed by the first script terminating or calling
<function>session_write_close</function>.
</para>
<para>
This is most likely to be an issue on Web sites that use AJAX heavily and
have multiple concurrent requests. The easiest way to deal with it is to
call <function>session_write_close</function> as soon as any required
changes to the session have been made, preferably early in the script.
Alternatively, a different session backend that does support concurrency
could be used.
</para>
</note>
</section>
<section xml:id="session.idpassing">