we kept getting some odd behavior, whem we checked have_perm("user") and in the database we have "user"... we got false!
So.. checking and doing a print_r on the array.. we see it was "userte" ??!?!? so..
after I finally narrowed it down to actually printing the values before and after, I had a revelation... we had had a problem with the Base64 encoding and the sessions BEFORE.. the error was definitely in then line (from perm.inc):
$userperm = split(",",auth->auth["perm"]);
try instead :
//get the value to a local var
$lperm = $newauth->auth["perm"];
//trim the value before splitting
$userperm = split(",", trim($lperm));
AND IT WORKED!!!!... so I trim anything that might come out of a session, especially if there is to be a split involved. My guess is that there are non-visible ascii values (#0, etc) stored in there that get all messed up when split is called.. perhaps something to watch for and recode the split function for later version of PHP.