php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9442 session blocking, version: all including 4.0.4pl1
Submitted: 2001-02-25 09:25 UTC Modified: 2001-06-19 10:00 UTC
From: Xuefer at 21cn dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.4pl1 OS: Window2000
Private report: No CVE-ID: None
 [2001-02-25 09:25 UTC] Xuefer at 21cn dot com
session blocking?
-----------------
when session start started
in the multi-framed webpage

if one frame did not finished running(keeping-alive and conneting), the other frame(using the same session id) will blocked until that frame finished

-----------------
often, an web-irc would like to keep one frame alive until user quit, when running it does soemthings, but other frames not work this time!!!

this problem not only bad for that keeping-alive php program to sessoin, but also bad for normal multi-frame's run speed, becos only one php running for 1 user, if no blocking, 2 or more running the same time.

if i use session_set_save_handle to use my own save handle, the problem went! is that the problem which internal session save handle used the file lock?
locking sessoin file until php program exited and session saved?
so how the other frame used by the same user works well?
-----------------
pls, fix it, find a way

but if fixed, another problem still covered
perhaps both frame1.php and frame2.php running
if frame1.php changed the session, will it effect in frame2 immediately?

-----------------
example is in:
http://www.phpwizard.net/phpChat
it use http://www.phpwizard.net/phpIRC
it works ok it php3, becos phpChat have its own session support, and was turned off in php4
so session blocking in php4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-14 23:26 UTC] sniper@php.net
Does this happen with latest CVS snapshot from http://www.zend.com/snapshots/ ??

 [2001-06-15 11:39 UTC] Xuefer at 21cn dot com
don't know
i think, it maybe the session file locking

i use my own handling for session, all thing going right.
i havn't do a locking for the row which session saved :P

maybe become another problem bcos no locking.

frame-> frameA, frameB
frameA: 1. start session, 2-4. do sth. 5. done, save session
frameB: 1. load session, 2. do sth. 3. done, save sesion

the numbers above is the time (sorry for my english :P)

and u c, session which loaded(needed) by frameB isn't the which saved from frameA.

so i suggest, add more session functions, like

session_save(); // save session
session_dettach();
or maybe session_end(); // release holded session, unlock, and other thread in the same session can access this
// also means session will not save again after php script done.

session_reload(); 
or maybe session_refresh(); // refresh session from saved data

i have written those function myself, but must be used with my own session handling. no way for me to unlock session file wich handled by default session handler of PHP


sample:
frame1: session_start(); session_register("done", "message");
$done = false;
while($done) {
if ($message) {
echo $message;
$message = "";
session_save();
}
}
frame2: session_start(); session_register("done", "message");
$message = "This is a test";
session_save();
sleep(1);
$message = "This is a test";
session_save();
...

hoho~~
things was made complex.

said to much;

In a word, give a way to unlock session file, not to hold it until script done. releasing lock may give other thread running at the sametime
 [2001-06-19 10:00 UTC] sniper@php.net
There has been fixes regarding blocking in CVS.
Try the snapshot. If it doesn't work, reopen.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC