PHP CSRF Protection: Generate and validate tokens against CSRF attacks

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 416 All time: 6,339 This week: 310Up
Version License PHP version Categories
php-csrf 1.0GNU General Publi...5.0PHP 5, Validation, Security
Description Author

This class can generate and validate tokens against CSRF attacks.

It creates a random token based on the current user IP address, browser identification.

The generated token is stored in a session variable that may include the name of the form on which the token will be used.

The class can also validate the generated token passed via a form field or a link parameter to verify if it matches the token stored in the session variable.

Picture of Radovan Janjic
  Performance   Level  
Name: Radovan Janjic is available for providing paid consulting. Contact Radovan Janjic .
Classes: 14 packages by
Country: Serbia Serbia
Age: 32
All time rank: 2542 in Serbia Serbia
Week rank: 93 Up1 in Serbia Serbia Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file CSRF.class.php Class Class source
Accessible without login Plain text file example.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:416
This week:0
All time:6,339
This week:310Up

For more information send a message to info at phpclasses dot org.