PHP Classes
elePHPant
Icontem

File: Example.php

Recommend this page to a friend!
  Classes of Mostafa Abd-El-Hamid  >  PHP Session CSRF Token Protection Library  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Session CSRF Token Protection Library
Validate tokens to protect against CSRF attacks
Author: By
Last change: Update Example.php
Date: 2 years ago
Size: 495 bytes
 

 

Contents

Class file image Download
<?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();