vividona Posted March 26, 2011 Share Posted March 26, 2011 Plz check the following code. It gave me this error Warning: array_map(): The first argument, 'self::prepSessions', should be either NULL or a valid callback public function resetSess(){ if($this->isLoggedIn){ session_regenerate_id(); $this->sessions = array( 'userId' => $_SESSION['userId'], 'username' => $_SESSION['username'], 'password' => $_SESSION['password'], 'uemail' => $_SESSION['uemail'], 'userLevel' => $_SESSION['userLevel'], 'userGroup' => $_SESSION['userGroup'], 'referrer' => $_SESSION['referrer'] ); $this->userdata = array_map("self::prepSessions", $this->sessions); }else{ return false; } } public function prepSessions($sessions){ if($this->isLoggedIn){ return $sessions; } } Quote Link to comment Share on other sites More sharing options...
flolam Posted March 26, 2011 Share Posted March 26, 2011 the array_map should be array_map(array("className", "prepSessions"), $this->sessions)) where, of course, className is to be replaced with whatever classname you have Quote Link to comment Share on other sites More sharing options...
vividona Posted March 28, 2011 Author Share Posted March 28, 2011 the array_map should be array_map(array("className", "prepSessions"), $this->sessions)) where, of course, className is to be replaced with whatever classname you have It works! thank you sooo much, flolam Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.