sciencehook/csrf-xsrf

This package is abandoned and no longer maintained. No replacement package was suggested.

CSRF attack protection library

1.0.0 2018-11-25 15:30 UTC

This package is auto-updated.

Last update: 2020-08-14 13:35:56 UTC


README

68747470733a2f2f7062732e7477696d672e636f6d2f70726f66696c655f696d616765732f313038313631303134313533383131313438382f6a413434514c4f695f343030783430302e6a7067

CSRF/ XSRF Security mini library for PHP applications. Embed and verify security tokens in forms without much hassle.

Generic badge Generic badge Latest Stable Version Test Coverage Scrutinizer Code Quality Total Downloads License

Table of Contents

  1. Installation
  2. Usage Examples
  3. Contribution
  4. License

Installation

Requirements:

PHP

This library is developed and tested on PHP 7.2. We do not know its backward compatibility. So, please test it before using it for PHP version less than 7.2.

Steps:

First, get Composer, if you don't already have it.

Next, run the following command in your terminal in PROJECT's directory:

composer require sciencehook/csrf-xsrf

Usage Examples

You can find the working examples in examples folder.

input_form.php is input form containing CSRF token and form_validation.php validates the token and proceeds accordingly.

Contribution

Please raise issues in case of any bugs or problems. To contribute, please create pull requests.

License

MIT License

Copyright (c) 2018 ScienceHook

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.