pikanji / plaincookie-plugin
Enable non-encrypted cookies
Installs: 51
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:october-plugin
Requires
- php: >=5.4
- composer/installers: ~1.0
This package is auto-updated.
Last update: 2025-03-01 00:24:16 UTC
README
OctoberCMS plugin that enables unencrypted cookies.
Cookies handled by OctoberCMS are always encrypted. This plugin lets the developer to specify cookies that should not be encrypted.
This is useful when you want to let the backend code to read the cookie value set in frontend.
This plugin becomes unnecessary when this PR is merged & released.
Usage
Installation
You can install this plugin via composer. Execute below at the root of your project.
composer require pikanji/plaincookie-plugin
Modify app.php
Modify bootstrap/app.php
to replace October\Rain\Foundation\Http\Kernel::class
with Pikanji\PlainCookie\Classes\Foundation\Http\Kernel::class
in http kernel binding.
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
// October\Rain\Foundation\Http\Kernel::class
Pikanji\PlainCookie\Classes\Foundation\Http\Kernel::class
);
Specifying Cookie Names
There are two ways to specify the cookies that you don't want to encrypt.
Via Config File
Add config/cookie.php
file that returns an array of the cookie names.
Example
<?php
return [
/*
|--------------------------------------------------------------------------
| Cookies that should not be encrypted
|--------------------------------------------------------------------------
|
| List the key of cookies that you do NOT want to encrypt.
|
*/
"unencryptedCookies" => [
"my_cookie",
],
];
From Code
Use Config
facade to add from your Plugin::boot()
.
Config::push('cookie.unencryptedCookies', "my_cookie");