PHP Classes

PHP Session CSRF Token Protection Library: Validate tokens to protect against CSRF attacks

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 72%Total: 457 All time: 6,106 This week: 146Up
Version License PHP version Categories
php-session-csrf 1.0.1Free for non-comm...7.0HTTP, Security, PHP 7
Description 

Author

This package can validate tokens to protect against CSRF attacks.

It can generate a random token that is stored in a session variable, it is served as request header, and can be used in forms or links for subsequent verification.

The class can also verify if a given token value matches what was stored in the token session variable.

Picture of Mostafa Abd-El-Hamid
  Performance   Level  
Name: Mostafa Abd-El-Hamid <contact>
Classes: 23 packages by
Country: Egypt Egypt
Age: 40
All time rank: 5595 in Egypt Egypt
Week rank: 354 Up6 in Egypt Egypt Down
Innovation award
Innovation award
Nominee: 5x

Example

<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */



require __DIR__ . 'CSRFSession.php';


// 1- To start initializing a token:
\CSRF\Session\Handlder::__start('any_mix_of_characters_as_the_key');




// 2- To put token to UI form:
\CSRF\Session\Handlder::__getToken();




// 3- To compare tokens UI and session:
\CSRF\Session\Handlder::__compare();


Details

CSRFPHP

CSRFPHP is in PHP written in REST Format and THERE WILL BE A VALUABLE XML Version SOOOON

RESTFul JSON Version is Now Available

Comming Soon...

SOAP WSDL XML Version...!!!

Installation

Run

composer require manonsys/csrf-session

composer update || composer install


  Files folder image Files  
File Role Description
Accessible without login Plain text file composer.json Data Auxiliary data
Plain text file CSRFSession.php Class Class source
Accessible without login Plain text file Example.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation
Plain text file SessionHandler.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:457
This week:0
All time:6,106
This week:146Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:91%StarStarStarStarStar
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:72%StarStarStarStar
Rank:186