PHPackages                             owasp/csrf-protector-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. owasp/csrf-protector-php

ActiveLibrary[Security](/categories/security)

owasp/csrf-protector-php
========================

CSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app.

v1.0.2(6y ago)223370.4k↓48.4%87[37 issues](https://github.com/mebjas/CSRF-Protector-PHP/issues)[4 PRs](https://github.com/mebjas/CSRF-Protector-PHP/pulls)2Apache-2.0PHP

Since Jul 25Pushed 1y ago15 watchersCompare

[ Source](https://github.com/mebjas/CSRF-Protector-PHP)[ Packagist](https://packagist.org/packages/owasp/csrf-protector-php)[ Docs](https://github.com/mebjas/CSRF-Protector-PHP)[ RSS](/packages/owasp-csrf-protector-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (2)

CSRF Protector
==============

[](#csrf-protector)

[![Todo Status](https://camo.githubusercontent.com/afabadae083d0459e622ea5e1e0ea28860f3b0ed981a6c5e94a58960aa02f7a9/687474703a2f2f746f646f66792e6f72672f622f6d65626a61732f435352462d50726f746563746f722d504850)](http://todofy.org/r/mebjas/CSRF-Protector-PHP)[![Build Status](https://camo.githubusercontent.com/cb71d14d40d1767513881ffdd498ebbce98e0822e24bc3896fd05d24740de2d7/68747470733a2f2f7472617669732d63692e6f72672f6d65626a61732f435352462d50726f746563746f722d5048502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mebjas/CSRF-Protector-PHP)[![Minimum PHP Version](https://camo.githubusercontent.com/599bc5c91bb804f9384b53af2a2d7143e7b787bf82a79f1773db76ef50e51ab5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e737667)](https://php.net/)
CSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app.

Add to your project using packagist
===================================

[](#add-to-your-project-using-packagist)

Add a `composer.json` file to your project directory

```
{
   "require": {
       "owasp/csrf-protector-php": "dev-master"
   }
}
```

Then open terminal (or command prompt), move to project directory and run

```
composer install

## Or alternatively

php composer.phar install
```

This will add CSRFP (library will be downloaded at `./vendor/owasp/csrf-protector-php`) to your project directory. View [packagist.org](https://packagist.org/) for more help with composer!

Configuration
=============

[](#configuration)

For composer installations: Copy the config.sample.php file into your root folder at config/csrf\_config.php For non-composer installations: Copy the `libs/csrf/config.sample.php` file into `libs/csrf/config.php`Edit config accordingly. See Detailed Information link below.

[Link to wiki - Editing Configurations &amp; Mandatory requirements before using this library](https://github.com/mebjas/CSRF-Protector-PHP/wiki/Configurations)

How to use
==========

[](#how-to-use)

```
