Download the PHP package hardywen/cookie-csrf without Composer

On this page you can find all versions of the php package hardywen/cookie-csrf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cookie-csrf

cookie-csrf

改写一个 laravel 的 csrf filter。原来的的方式需要将token放到表单字段里一起提交。比较麻烦。 重新改写一个 cookie-csrf filter, 功能如下:

1. 将 token 放在cookie里 (cookie_csrf_token)。 不需要每个表单都加上token字段,更方便使用。
2. token值使用后马上重新生成一个新token,可以有效防止重复提交。

Install

添加 到 composer.json 里

运行 命令安装

Config

默认的配置是:

即所有路径的 post,put,delete 方法都进行 cookie-csrf 过滤。

你可以运行 复制出配置文件,然后改按你的需要来配置。

当,则不自动使用cookie-csrf, 你可以自己按需要去手动调用 cookie-csrf 过滤。

Others

除了服务端进行防止重复提交之外,前台也应该用js防止重复提交表单的设置。例如防止jQuery ajax重复提交可以按以下方式配置:

jQuery的ajax配置,在每次进行ajax之前需要判断一下是否正在处理表单,如果formSubmitting为true是,不会再提交。等ajax完成后,再将formSubmitting改回false。

防止直接提交表单的方式如下(点击submit按钮后将其disable,就不能再次点击了):


All versions of cookie-csrf with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hardywen/cookie-csrf contains the following files

Loading the files please wait ....