PHPackages                             timur-flush/sofa-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. timur-flush/sofa-csrf

ActiveLibrary[Security](/categories/security)

timur-flush/sofa-csrf
=====================

The library is designed to be soft csrf protection in Phalcon application.

v1.0.0(7y ago)036BSD-3-ClausePHPPHP ^7.2.0

Since Jul 6Pushed 7y agoCompare

[ Source](https://github.com/TimurFlush/sofa-csrf)[ Packagist](https://packagist.org/packages/timur-flush/sofa-csrf)[ RSS](/packages/timur-flush-sofa-csrf/feed)WikiDiscussions 1.x Synced 3w ago

READMEChangelogDependenciesVersions (4)Used By (0)

Sofa Csrf
=========

[](#sofa-csrf)

The library is designed to be soft csrf protection in Phalcon application.

Attention please
----------------

[](#attention-please)

The token is permanent within the current session. Even if the token is entered incorrectly, it is not updated within the current session.

Using
-----

[](#using)

```
//in Dependency Injection
$di->setShared(
    'csrf',
    function() {
        //The variable must store the value of interface \Phalcon\Session\AdapterInterface
        $sessionAdapter = $this->getSession();

        return new \TimurFlush\SofaCsrf\Protection($sessionAdapter);
    }
);

//in form
class form extends \Phalcon\Form
{
    public function initialize()
    {
        $csrf = new Hidden('csrf_token');
        $csrf->addValidator(
            new \TimurFlush\SofaCsrf\Validator\Csrf(
                [
                    'message' => 'Invalid csrf. Try again!'
                    //option 'cancelOnFail' is already installed
                ]
            )
        );
    }
}

```

License
-------

[](#license)

BSD-3-Clause

Version
-------

[](#version)

2.0.0-B1

Author
------

[](#author)

Timur Flush

E-mail:

Telegram: @flush02

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~2 days

Total

3

Last Release

2906d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29764676?v=4)[timurflush](/maintainers/TimurFlush)[@TimurFlush](https://github.com/TimurFlush)

### Embed Badge

![Health badge](/badges/timur-flush-sofa-csrf/health.svg)

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

###  Alternatives

[mews/purifier

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

2.0k18.0M134](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k35](/packages/paragonie-ecc)[fof/recaptcha

Increase your forum's security with Google reCAPTCHA

1436.9k](/packages/fof-recaptcha)

PHPackages © 2026

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