Code Monkey home page Code Monkey logo

csrf-protector-php's Introduction

CSRF Protector

Todo Status Build Status Minimum PHP Version
CSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app.

Add to your project using packagist

Add a composer.json file to your project directory

{
   "require": {
       "owasp/csrf-protector-php": "dev-master"
   }
}

Then open terminal (or command prompt), move to project directory and run

composer install

## Or alternatively

php composer.phar install

This will add CSRFP (library will be downloaded at ./vendor/owasp/csrf-protector-php) to your project directory. View packagist.org for more help with composer!

Configuration

For composer installations: Copy the config.sample.php file into your root folder at config/csrf_config.php For non-composer installations: Copy the libs/csrf/config.sample.php file into libs/csrf/config.php Edit config accordingly. See Detailed Information link below.

Link to wiki - Editing Configurations & Mandatory requirements before using this library

How to use

<?php
include_once __DIR__ .'/vendor/owasp/csrf-protector-php/libs/csrf/csrfprotector.php';

// Initialise CSRFProtector library
csrfProtector::init();

simply include the library and call the init() function!

More information

Discussions

Join Discussions at Google Group \ OWASP \ CSRF Protector

For any other queries contact me at: [email protected] | [email protected]

How to contribute?

General steps

  • Fork the repo
  • Create your branch
  • Commit your changes
  • Create a pull request

More?

Well, there are various ways to contribute to this project. Find a few of them listed below:

  • Found a bug? Raise a bug in the issue page. Please make sure it's not a duplicate of an existing issue.
  • Have a feature request? Raise one at the issue page. As mentioned above please do a basic check if this enhancement exists in the mentioned link.
  • Want to contribute code to this project?
    • The best way to start is by picking up one of the existing issues with Up For Grab label.
    • Leave a comment, that you intend to help on this > then fork > and then send a pull request to master branch.

FAQ:

  1. What happens if token expires? - https://github.com/mebjas/CSRF-Protector-PHP/wiki/what-if-token-expires
  2. Secure flag in a cookie? - mebjas#54
  3. [Deprecated] NoJS support? - https://github.com/mebjas/CSRF-Protector-PHP/tree/nojs-support

csrf-protector-php's People

Contributors

mebjas avatar oittaa avatar mberkowski avatar bstoney avatar abhinavdahiya avatar polishdeveloper avatar nikivanstein avatar davidfricker avatar johnmaguire avatar stephenlawrence avatar msalestream avatar sautdechat avatar aduh95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.