CSRF protector 1.0
CSRF protector can generate a random key and store it in a database record associated to the current session. It uses PEAR MDB2 database abstraction layer to support many types of databases.
When the form is submitted with a token hidden input field, the class can also check if the key is valid. If it exists, the key record is deleted from the database to avoid it is reused.
PHP 5 or higher