Right when you get the data in your code, such as a login script, at the top of the code before you actually process the login, or while you are processing the login
Examples
login.php
Code: Select all
$_SESSION'username = $this->cleanse($_POST'username);
$_SESSION'password = $this->cleanse($_POST'password);
processLogin($username, $password);// login function does not have to worry about currupt data, can pull directly from session
//and all other classes can pull from session without worry
wait I already know the answer... cleanse it first so you don't have to worry about it during the rest of the code ^.^