php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44400 session_start appears to block other requests
Submitted: 2008-03-10 21:41 UTC Modified: 2008-03-10 22:26 UTC
From: webmaster at drarok dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.2.5 OS: Windows/FreeBSD
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 27 = ?
Subscribe to this entry?

 
 [2008-03-10 21:41 UTC] webmaster at drarok dot com
Description:
------------
Calling session_start() appears to wait until other scripts have exited 
that are using the same session. My guess is the 1st request locks the 
session file for exclusive use, and the second request blocks until it 
can open it.

Reproduce code:
---------------
I have a fully working proof of concept at http://www.drarok.com/test.php with the source available at http://www.drarok.com/test.phps


Expected result:
----------------
I would except the asynchronous requests to come back in the order they 
finish. Request 2 doesn't call sleep(), so should always finish 1st.

Actual result:
--------------
Request 1 blocks for 2 seconds, then request 2 returns immediately after 
request 1 finishes.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-10 22:26 UTC] colder@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is expected, the session file is locked to avoid corruption.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC