2017 © Pedro Peláez
 

october-plugin plaincookie-plugin

Enable non-encrypted cookies

image

pikanji/plaincookie-plugin

Enable non-encrypted cookies

  • Thursday, July 19, 2018
  • by pikanji
  • Repository
  • 1 Watchers
  • 0 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

OctoberCMS Plain Cookie Plugin

日本語版はこちら, (*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)

Usage

Installation

You can install this plugin via composer. Execute below at the root of your project., (*6)

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., (*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)

Via Config File

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",
    ],
];

From Code

Use Config facade to add from your Plugin::boot()., (*11)

Config::push('cookie.unencryptedCookies', "my_cookie");

The Versions

19/07 2018

dev-master

9999999-dev

Enable non-encrypted cookies

  Sources   Download

MIT

The Requires

 

by Kanji Furuhashi

plugin cookie cms october pikanji