PHP Package: symfony/security-csrf

Symfony CSRF component provides protection against Cross-Site Request Forgery attacks in PHP applications.

Current Version: 7.2.3
Last Updated: 2025-01-29
PHP Requirement: >=7.1
Dependencies: symfony/http-foundation, symfony/http-kernel
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

Symfony security-csrf library offers a robust solution for preventing CSRF attacks by generating and validating unique tokens for each user session. It seamlessly integrates with Symfony security features, ensuring a secure web application environment. With its flexible configuration options and comprehensive documentation, developers can easily implement CSRF protection in their projects.

🔗 View on GitHub

Download Latest Version: 7.2.3

Download Download v7.2.3

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php

// Example from PHPlibraries.com
require_once 'libs/symfony/security-csrf/7.2.3/autoload.php';

use Symfony\Component\Security\Csrf\CsrfToken;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage;


$obj = new Symfony\Component\Security\Csrf\CsrfToken();
echo "✅ Example created successfully.";

?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.