It works like this:
(page 1) Registration - form page
2) Registration - submit page (define my values and store in a SESSION)
3a) Demo3_client
calls - 3b) Demo3_config (values pulled off my SESSION)
4a) Demo3_server
calls - 4b) Demo3_config (values pulled off my SESSION)
I was discovering that the submit page was accessing old (from prior visit to chat) values in my SESSION. So I decided to use page 1 to clear all old SESSION data related to pfc. So I looked at the entire SESSION array and it turns out there is more in there then I personally set. The pfc software is setting values which I wasn't aware. That might have been reason for some things confusing me, some things being stubborn too. Fortuitously, I was using SESSION nomenclature similar to pfc developer. All pfc SESSION values have a key starting "pfc". Some had "pfc_", but sometimes just "pfc". So on page 1 I unset all the pfc variables in my SESSION like this:
- Code: Select all
//--------------------------------------------------------------------------
// Clear SESSION variables stored on prior visits
//--------------------------------------------------------------------------
//echo '<pre>'; // for debug
//echo '<br /><br />before clearing $_SESSION = <br />'; // for debug
//print_r($_SESSION); //for debug
//echo '</pre><br />'; // for debug
// NOTE: I defined all my pfc related SESSION variables similar to the
// pfc developer, we both use "pfc" or "pfc_" at the beggining of key name.
// So will loop thru the SESSION array and for every variable that has
// such a key name, will redefine to empty string "".
foreach ($_SESSION as $key => $value) {
// check first 3 characters of $key if "pfc".
if ( strcmp( "pfc", (substr($key,0,3)) )==0 ) {
unset($_SESSION[$key]); // unset this SESSION variable
}
}
//echo '<pre>'; // for debug
//echo '<br /><br />after clearing $_SESSION = <br />'; // for debug
//print_r($_SESSION); //for debug
//echo '</pre><br />'; // for debug
//die('<br />Stop point #1 for debugging'); // for debug
Above is cut and paste from my script. You see how I read the before and after values for debugging, just uncommment those lines.
So this really helped things. Now I can be more dynamic in setting which channels, frozen channels, etc that user can access.
I've also discovered some other coding mistakes I made, particularly setting the array of frozen_channels. So that fixed me too.
Perhaps this will help other people?
After these changes I did the /rehash and at first it didn't seem like things were happy. So I /rehash again, then close window. After starting all over fresh it seems to be more happy. Hope it stays happy.