{"id":16865864,"url":"https://github.com/mebjas/csrf-protector-php","last_synced_at":"2025-05-16T07:05:47.053Z","repository":{"id":16592026,"uuid":"19346403","full_name":"mebjas/CSRF-Protector-PHP","owner":"mebjas","description":"CSRF Protector library: standalone library for CSRF mitigation","archived":false,"fork":false,"pushed_at":"2024-07-12T07:08:09.000Z","size":363,"stargazers_count":212,"open_issues_count":42,"forks_count":88,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-11T10:39:30.445Z","etag":null,"topics":["csrf","csrf-protector","owasp","php","security","standalone-library"],"latest_commit_sha":null,"homepage":"https://owasp.org/www-project-csrfprotector/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"contra/rtc-everywhere","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mebjas.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-05-01T14:16:46.000Z","updated_at":"2025-03-12T13:54:05.000Z","dependencies_parsed_at":"2025-04-12T16:49:58.522Z","dependency_job_id":null,"html_url":"https://github.com/mebjas/CSRF-Protector-PHP","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebjas%2FCSRF-Protector-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebjas%2FCSRF-Protector-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebjas%2FCSRF-Protector-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mebjas%2FCSRF-Protector-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mebjas","download_url":"https://codeload.github.com/mebjas/CSRF-Protector-PHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485062,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csrf","csrf-protector","owasp","php","security","standalone-library"],"created_at":"2024-10-13T14:48:42.716Z","updated_at":"2025-05-16T07:05:44.252Z","avatar_url":"https://github.com/mebjas.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CSRF Protector\n==========================\n[![Todo Status](http://todofy.org/b/mebjas/CSRF-Protector-PHP)](http://todofy.org/r/mebjas/CSRF-Protector-PHP)\n[![Build Status](https://travis-ci.org/mebjas/CSRF-Protector-PHP.svg?branch=master)](https://travis-ci.org/mebjas/CSRF-Protector-PHP) \n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.4-8892BF.svg)](https://php.net/)\n\u003cbr\u003eCSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app. \n\n# Add to your project using packagist\n Add a `composer.json` file to your project directory\n ```json\n {\n    \"require\": {\n        \"owasp/csrf-protector-php\": \"dev-master\"\n    }\n}\n```\nThen open terminal (or command prompt), move to project directory and run\n```shell\ncomposer install\n\n## Or alternatively\n\nphp composer.phar install\n```\nThis 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!\n\n# Configuration\nFor composer installations: Copy the config.sample.php file into your root folder at config/csrf_config.php\nFor non-composer installations: Copy the `libs/csrf/config.sample.php` file into `libs/csrf/config.php`\nEdit config accordingly. See Detailed Information link below.\n\n[Link to wiki - Editing Configurations \u0026 Mandatory requirements before using this library](https://github.com/mebjas/CSRF-Protector-PHP/wiki/Configurations)\n\n# How to use\n```php\n\u003c?php\ninclude_once __DIR__ .'/vendor/owasp/csrf-protector-php/libs/csrf/csrfprotector.php';\n\n// Initialise CSRFProtector library\ncsrfProtector::init();\n```\nsimply include the library and call the `init()` function!\n\n### More information \n - [Project wiki on Github](https://github.com/mebjas/CSRF-Protector-PHP/wiki)\n - [OWASP wiki](https://www.owasp.org/index.php/CSRFProtector_Project)\n\n## Discussions\nJoin Discussions at [Google Group \\ OWASP \\ CSRF Protector](https://groups.google.com/a/owasp.org/forum/#!forum/csrfprotector-project)\n\nFor any other queries contact me at: minhazav@gamil.com | minhaz@owasp.org\n\n## How to contribute?\n### General steps\n - Fork the repo\n - Create your branch\n - Commit your changes\n - Create a pull request\n\n### More?\nWell, there are various ways to contribute to this project. Find a few of them listed below:\n - Found a bug? Raise a bug in [the issue page](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3Abug). Please make sure it's not a duplicate of an existing issue.\n - Have a feature request? Raise one at [the issue page](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement). As mentioned above please do a basic check if this `enhancement` exists in the mentioned link.\n - Want to contribute code to this project?\n   - The best way to start is by picking up one of the existing [issues with `Up For Grab` label](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3A%22Up+For+Grabs%22). \n   - Leave a comment, that you intend to help on this \u003e then fork \u003e and then send a pull request to `master branch`.\n\n## FAQ:\n1. What happens if token expires? - https://github.com/mebjas/CSRF-Protector-PHP/wiki/what-if-token-expires\n2. Secure flag in a cookie? - https://github.com/mebjas/CSRF-Protector-PHP/issues/54\n3. \\[Deprecated\\] ~NoJS support? - https://github.com/mebjas/CSRF-Protector-PHP/tree/nojs-support~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmebjas%2Fcsrf-protector-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmebjas%2Fcsrf-protector-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmebjas%2Fcsrf-protector-php/lists"}