Sessions and multiple windows

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

 



Hi List

I am afraid that this is going to be a long complicated question. And to start off with I have RTFM, STFA, STFW - and have yet to find the answer I am looking for - unless, perhaps I am asking the wrong question?

But back to the subject - I have an app that allows users to open multiple windows to perform certain tasks. Even though the user has multiple windows, from the point of view of the app it is classified as a single session.

For this app I have an object stored in a session variable that I use to administer logins, permissions etc. - call it $_SESSION['policeman']. This object stores information that is common to all windows (e.g. path to common error logging, current user id etc).

A simpler version fo this app did not allow for the opening of multiple windows and I needed to check if the user was logged in every time he/she went to a new page. I did this by putting a call to the checkLogin method inside $_SESSION['policeman']'s __wakeup method. Then , every time PHP unserialized $_SESSION['policeman'] it checked for the login.

I would like to do a similar thing with the more complex apps, but i do not know enough to be sure that it won't cause a problem and to be quite honest, I am not even entirely sure how to test it. My problen lies in a scenario such as this:

User clicks through to page_3.php from page_2.php.

Page_3.php starts, unserializes $_SESSION['policeman'], and begins a lengthy SQL query that will take a few minutes to complete.

The user wants to do something else so he\she opens a new window for page_9.php (at this point page_3.php has yet to complete).

Now, the question is, what will PHP do when it starts with page_9? Will it unserialize $_SESSION['policeman'] again, even though it already has an unserialized instance of $_SESSION['policeman']? If it does unserialize, does that mean that it creates a second instance of $_SESSION['policeman'], thereby breaking the common link that I am trying to provide?

I hope someone will be able to point me in the right direction...

TIA
--
Rory McKinley
Nebula Solutions
+27 21 555 3227 - office
+27 21 551 0676 - fax
+27 82 857 2391 - mobile
www.nebula.co.za
====================

--
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