I have sessions that for the website and this is how i use them:
   $username = CleanMe($_SESSION["username"]);
   $password = CleanMe($_SESSION["password"]);
   //return clean values
   $_SESSION["username"] = $username;
   $_SESSION["password"] = $password;
CleanMe is:
       function CleanMe($strWords){ 
       $bad_string = array("select", "drop", ";", "--", "insert","delete", 
       "xp_", "%20union%20", "/*", "*/union/*", "+union+", "load_file", 
       "outfile", "document.cookie", "onmouse", "<script", "<iframe", "<applet", 
       "<meta", "<style", "<form", "<img", "<body", "<link", "_GLOBALS", "_REQUEST", 
       "_GET", "_POST", "include_path", "prefix", "http://", "https://", 
       "ftp://", "smb://", "'", "\""); 
       for ($i = 0; $i < count($bad_string); $i++){ 
       $strWords = str_replace ($bad_string[$i], "", $strWords); 
       } 
       return $strWords; 
       }
Now, does it make sense for me to use mysql_real_escape_string or what i have, CleanMe is more secure?
 
     
     
     
    