PHPackages                             uwdoem/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. [Security](/categories/security)
4. /
5. uwdoem/csrf

Abandoned → [athens/csrf](/?search=athens%2Fcsrf)Library[Security](/categories/security)

uwdoem/csrf
===========

Simple CSRF protection

2.1.0(9y ago)09981[1 PRs](https://github.com/UWEnrollmentManagement/CSRF/pulls)PHP

Since Aug 21Pushed 9y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (4)Versions (10)Used By (0)

[![Build Status](https://camo.githubusercontent.com/dbc0150fafc24bb8e7c94ff41832d42428f702b20ca5df4a1a9164e991607135/68747470733a2f2f7472617669732d63692e6f72672f417468656e734672616d65776f726b2f637372662e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AthensFramework/csrf)[![Code Climate](https://camo.githubusercontent.com/a3a35da2dc5e60840f1c68c5704cb59c9b5785b2a25acab49a408f127e0e8e56/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f417468656e734672616d65776f726b2f637372662f6261646765732f6770612e737667)](https://codeclimate.com/github/AthensFramework/csrf)[![Test Coverage](https://camo.githubusercontent.com/41928d47be15d214490a9fbb757539679c927fc96a80b4ce319e13bfffe215d1/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f417468656e734672616d65776f726b2f637372662f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/AthensFramework/csrf/coverage)[![Latest Stable Version](https://camo.githubusercontent.com/46a862bb292ab262466af09088a85669183ebdc847c9ad270dd0635f21f7c69c/68747470733a2f2f706f7365722e707567782e6f72672f617468656e732f637372662f762f737461626c65)](https://packagist.org/packages/athens/csrf)

Athens/CSRF
===========

[](#athenscsrf)

Easily protect against [CSRF](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)) attacks.

Installation
------------

[](#installation)

This library is published on packagist. To install using Composer, add the `"athens/csrf": "0.1.*"` line to your "require" dependencies:

```
{
    "require": {
        ...
        "athens/csrf": "1.*",
        ...
    }
}

```

Of course, if you're not using Composer then you can download the repository using the *Download ZIP* button at right.

Use
---

[](#use)

Using this package requires only two lines:

```
    // Import the CSRF class
    use Athens\CSRF\CSRF;

    // Intialize
    CSRF::init();

```

The method `::init()` will automatically insert a hidden CSRF token field into your forms:

```

    ...

    ...

```

This token will be included automatically in any of your form submissions.

Incase you perform form submission via AJAX, `::init()` also inserts a `CSRF_TOKEN` variable into your javascript:

```

    ...

        var CSRFTOKEN = '37328bc2cac3e73623bc38ab0f4068ee7fa1';
    ...

```

This token will not automatically be included in your AJAX requests, but you may include it manually by referring to the `CSRFTOKEN` var in your submission script.

Compatibility
-------------

[](#compatibility)

- PHP 5.5, 5.6, 7.0

Todo
----

[](#todo)

See GitHub [issue tracker](https://github.com/AthensFramework/CSRF/issues/).

Getting Involved
----------------

[](#getting-involved)

Feel free to open pull requests or issues. [GitHub](https://github.com/AthensFramework/CSRF) is the canonical location of this project.

Here's the general sequence of events for code contribution:

1. Open an issue in the [issue tracker](https://github.com/AthensFramework/CSRF/issues/).
2. In any order:

- Submit a pull request with a **failing** test that demonstrates the issue/feature.
- Get acknowledgement/concurrence.

3. Revise your pull request to pass the test in (2). Include documentation, if appropriate.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Recently: every ~73 days

Total

9

Last Release

3484d ago

Major Versions

0.1.1 → 1.0.02015-12-17

1.2.0 → 2.0.02016-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b43989ce7a387c05c59282788d15171a28abf61e02614a7a005cb19ef8da2b4?d=identicon)[JASchilz](/maintainers/JASchilz)

---

Top Contributors

[![JASchilz](https://avatars.githubusercontent.com/u/6137968?v=4)](https://github.com/JASchilz "JASchilz (42 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/uwdoem-csrf/health.svg)

```
[![Health](https://phpackages.com/badges/uwdoem-csrf/health.svg)](https://phpackages.com/packages/uwdoem-csrf)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

87117.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[paragonie/hidden-string

Encapsulate strings in an object to hide them from stack traces

7410.6M39](/packages/paragonie-hidden-string)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
