2017 © Pedro Peláez
 

library cookie

Session Libraries for Kecik Framework

image

kecik/cookie

Session Libraries for Kecik Framework

  • Thursday, July 14, 2016
  • by dnaextrim
  • Repository
  • 1 Watchers
  • 1 Stars
  • 152 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Kecik Cookie

Is libraries were created specifically for the Kecik Framework, this library This library is made to facilitate the use of cookies on the project we build. This library also supports data encryption so that we secure the cookie data., (*1)

Installation

Add the following line to the file composer.json located on the project we want to build., (*2)

{
    "require": {
        "kecik/kecik": "1.0.*@dev",
        "kecik/cookie": "1.0.*@dev"
    }
}

Next, run the command, (*3)

composer update

And wait until the update process is completed without error., (*4)

Note: This library requires Kecik Framework, so we need to install Kecik Framework first, and then we can install this library., (*5)

<?php
require "vendor/autoload.php";

$app = new Kecik\Kecik();
$cookie = new Kecik\Cookie($app);

Whereas if you want a cookie in an encrypted then we simply add the config encryption, (*6)

<?php
require "vendor/autoload.php";

$app = new Kecik\Kecik();

//Config for encrypt cookie
$app->config->set('cookie.encrypt', TRUE);
$cookie = new Kecik\Cookie($app);

set()

This Function/Method use for create/update a cookie., (*7)

set(string $name, mixed $value)

Example:, (*8)

<?php
require "vendor/autoload.php";

$app = new Kecik\Kecik();
$cookie = new Kecik\Cookie($app);
$cookie->set('integer', 123);
$cookie->set('string', 'satu dua tiga');
$cookie->set('array', array('satu', 'dua', 'tiga'));

get()

This Function/Method use for get a value from a cookie., (*9)

get(string $name)

Example:, (*10)

<?php
require "vendor/autoload.php";

$app = new Kecik\Kecik();
$cookie = new Kecik\Cookie($app);
$cookie->set('integer', 123);
$cookie->set('string', 'satu dua tiga');
$cookie->set('array', array('satu', 'dua', 'tiga'));

echo 'cookie Integer: '.$cookie->get('integer').'<br />';
echo 'cookie String: '.$cookie->get('string').'<br />';
echo 'cookie Array: ';
print_r($cookie->get('array'));

delete()

This Function/Method use for delete a cookie., (*11)

delete(string $name)

Example:, (*12)

<?php
require "vendor/autoload.php";

$app = new Kecik\Kecik();
$cookie = new Kecik\Cookie($app);
$cookie->set('kecik_cookie', 'ini nilai cookie nya');

echo 'kecik_cookie: '.$cookie->get('kecik_cookie').'<br />';

$cookie->delete('kecik_cookie');
echo 'kecik_cookie: '.$cookie->get('kecik_cookie').'<br />';

clear()

This Function/Method use for delete all cookie are exist. Example:, (*13)

<?php
require "vendor/autoload.php";

$app = new Kecik\Kecik();
$cookie = new Kecik\Cookie($app);

$cookie->clear();

The Versions

14/07 2016

dev-master

9999999-dev

Session Libraries for Kecik Framework

  Sources   Download

MIT

The Requires

 

by Dony Wahyu Isp

framework cookie kecik

01/11 2015

1.0.2

1.0.2.0

Session Libraries for Kecik Framework

  Sources   Download

MIT

The Requires

 

by Dony Wahyu Isp

framework cookie kecik

07/04 2015

1.0.1-beta

1.0.1.0-beta

Session Class untuk Kecik Framework

  Sources   Download

MIT

The Requires

 

by Dony Wahyu Isp

framework cookie kecik