RE: Recursing sessions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Blanchard wrote:

> [snip]
> I am debugging a PHP session manager and this behavior is keeping the
> system from working correctly.
> [/snip]
> 
> A more descriptive explanation along with some code will help us to help
> you. AFAICS we do not have enough information to go on. Does each frame
> generate its own session? Can you show us that? The last session setter
> always wins if the variables are the same. So, if I say;
> 
> $_SESSION['user'] = 'foo';
> $_SESSION['user'] = 'bar';
> 
> echo $_SESSION['user'];
> 
> Like any good variable will return its last given value;

Sorry, here's more information:

I have a remote session system, like a database or a cache.
I have an Apache server running PHP 5 (although it does it on 4.x as well)
I am running Squirrelmail on the server.
Squirrelmail has frames.
The frames on squirrelmail each use the same session information
Multiple frame requests are sent from the browser at the same time.
The time to handle the requests is a non-zero amount of time that varies
with each frame
session_start is called for each frame request
The frame pages are processed
The session information saved via (I believe) session_write_close for the
frame requests
as each frames modifications to the session data is saved, the last session
to finish ends up writing the final version of the session data.

A log looks like this:

PS_READ_FUNC()
PS_READ_FUNC()
PS_WRITE_FUNC()
PS_WRITE_FUNC()

It should look like this:

PS_READ_FUNC()
PS_WRITE_FUNC()
PS_READ_FUNC()
PS_WRITE_FUNC()


In my session handler code, I have added a loop that looks like this:

        for(tstart=time(0); elapsed < 30; elapsed = time(0) - tstart)
        {
                stat = network_lock(xkey);
                if(stat==LOCK_OK)
                {
                        NETLOCK_G(fdlock) = xkey;
                        break;
                }
                sleep(1); // Connection is busy, sleep for a second
        }


This fixes the problem, but requires that PHP poll. I can put the same login
the the network system, but then that requires a socket and perhaps a
thread.

Does PHP have a way to tell the browser to respond once frame at a time, or
some more efficient serialization methodology.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux