dev-master
9999999-devEnable non-encrypted cookies
MIT
The Requires
- php >=5.4
- composer/installers ~1.0
by Kanji Furuhashi
plugin cookie cms october pikanji
Enable non-encrypted cookies
日本語版はこちら, (*1)
OctoberCMS plugin that enables unencrypted cookies., (*2)
Cookies handled by OctoberCMS are always encrypted. This plugin lets the developer to specify cookies that should not be encrypted., (*3)
This is useful when you want to let the backend code to read the cookie value set in frontend., (*4)
This plugin becomes unnecessary when this PR is merged & released., (*5)
You can install this plugin via composer. Execute below at the root of your project., (*6)
composer require pikanji/plaincookie-plugin
Modify bootstrap/app.php
to replace October\Rain\Foundation\Http\Kernel::class
with Pikanji\PlainCookie\Classes\Foundation\Http\Kernel::class
in http kernel binding., (*7)
$app->singleton( Illuminate\Contracts\Http\Kernel::class, // October\Rain\Foundation\Http\Kernel::class Pikanji\PlainCookie\Classes\Foundation\Http\Kernel::class );
There are two ways to specify the cookies that you don't want to encrypt., (*8)
Add config/cookie.php
file that returns an array of the cookie names., (*9)
Example, (*10)
<?php return [ /* |-------------------------------------------------------------------------- | Cookies that should not be encrypted |-------------------------------------------------------------------------- | | List the key of cookies that you do NOT want to encrypt. | */ "unencryptedCookies" => [ "my_cookie", ], ];
Use Config
facade to add from your Plugin::boot()
., (*11)
Config::push('cookie.unencryptedCookies', "my_cookie");
Enable non-encrypted cookies
MIT
plugin cookie cms october pikanji