PHPackages                             zoxta/csrf - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. zoxta/csrf

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

zoxta/csrf
==========

A quick and easy stateless CSRF protection for forms.

0.1.2(10y ago)060MITPHP

Since Sep 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/zOxta/quick-csrf)[ Packagist](https://packagist.org/packages/zoxta/csrf)[ RSS](/packages/zoxta-csrf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Quick CSRF
==========

[](#quick-csrf)

[![Latest Stable Version](https://camo.githubusercontent.com/9cfdf6d8bb8f7373b5f093d49109975e07c48363b6af54f68745122d23484cec/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7874612f637372662f762f737461626c65)](https://packagist.org/packages/zoxta/csrf) [![Total Downloads](https://camo.githubusercontent.com/99794434a8983e39d71cbe5512c8d8a179dab178002d3d51a45668a39d880a8d/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7874612f637372662f646f776e6c6f616473)](https://packagist.org/packages/zoxta/csrf) [![Latest Unstable Version](https://camo.githubusercontent.com/f70f00686be6ac316dbbf9aed76927cd653e5c8a57ec9c6c2d52d3ad02624da9/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7874612f637372662f762f756e737461626c65)](https://packagist.org/packages/zoxta/csrf) [![License](https://camo.githubusercontent.com/be5304210e5298de9032f75946b3ecb20ff1fc7c02b02b29d30f8f44586f3854/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7874612f637372662f6c6963656e7365)](https://packagist.org/packages/zoxta/csrf)

Quick CSRF offers stateless CSRF protection for forms that requires almost zero-configuration. It uses the JSON Web Token standard so it does not depend on session/cookies.

Quick CSRF depends on the beautiful [lcobucci/jwt](https://github.com/lcobucci/jwt) JWT implementation.

Installation
============

[](#installation)

Edit your project's `composer.json` to require `zoxta/csrf`.

```
"require": {
    "zoxta/csrf": "dev-master"
}

```

Then run `composer update`

Usage
=====

[](#usage)

Just instantiate the class and you will be ready to go. You will also find an sample usage in the `example` directory.

```
