PHP Classes


Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP CSRF Token Generation   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP CSRF Token Generation
Generate tokens to protect against CSRF attacks
Author: By
Last change: Update
Date: 5 years ago
Size: 969 bytes


Class file image Download


This package can generate token for csrf security in forms and add token to url


1. Generate new token on refresh/reload/open 2. Delete expire tokens automatically 3. Set time ( for tokens after how many time expire) 4. Delete current token (that passed in url) 5. Debug support 6. Verify tokens is exists or not 7. Count tokens 8. Delete unnecessary tokens.


This package can generate tokens to protect against CSRF attacks. It can create a string that is stored in a session variable and will be used to identify a real user that submits a form in the script that handles the form submission. The package can verify whether the user really submitted the form checking the token string by comparing the string passed via an URL parameter or an hidden form input. Tokens are valid for a configurable amount of time and are deleted after they expire.

Input class

get form