2017 © Pedro Peláez
 

library cookie

Client side persistent data

image

eden/cookie

Client side persistent data

  • Friday, November 13, 2015
  • by cblanquera
  • Repository
  • 4 Watchers
  • 0 Stars
  • 7,610 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

logo Eden Cookie

Build Status

====, (*1)

, (*2)

Install

composer install eden/cookie, (*3)

====, (*4)

, (*5)

Introduction

Instantiate cookies in this manner., (*6)

$cookie = eden('cookie');

The cookie is returned is an array object and can be used like a normal array., (*7)

$cookie['me']    = array('name' => 'John', 'age' => 31);
$cookie['you']    = array('name' => 'Jane', 'age' => 28);
$cookie['him']    = array('name' => 'Jack', 'age' => 35);

foreach($cookie as $key => $value) {
    echo $value['name'];
}

====, (*8)

, (*9)

API

====, (*10)

, (*11)

clear

Removes all cookies., (*12)

Usage

eden('cookie')->clear();

Parameters

Returns Eden\Cookie\Index, (*13)

====, (*14)

, (*15)

get

Returns data, (*16)

Usage

eden('cookie')->get(*string|null $key);

Parameters

  • *string|null $key - The key to retreive

Returns mixed, (*17)

Example

eden('cookie')->get('foo');

====, (*18)

, (*19)

remove

Removes a cookie., (*20)

Usage

eden('cookie')->remove(*string $name);

Parameters

  • *string $name - The cookie name

Returns Eden\Cookie\Index, (*21)

Example

eden('cookie')->remove('foo');

====, (*22)

, (*23)

set

Sets a cookie., (*24)

Usage

eden('cookie')->set(*string $key, scalar $data, int $expires, string $path, string|null $domain, bool $secure, bool $httponly);

Parameters

  • *string $key - Cookie name
  • scalar $data - The data
  • int $expires - Expiration
  • string $path - Path to make the cookie available
  • string|null $domain - The domain
  • bool $secure - Use secure cookie
  • bool $httponly - Make it only available on http://

Returns Eden\Cookie\Index, (*25)

Example

eden('cookie')->set('foo');

====, (*26)

, (*27)

setData

Sets a set of cookies., (*28)

Usage

eden('cookie')->setData(*array $data, int $expires, string $path, string|null $domain, bool $secure, bool $httponly);

Parameters

  • *array $data - The list of cookie data
  • int $expires - Expiration
  • string $path - Path to make the cookie available
  • string|null $domain - The domain
  • bool $secure - Use secure cookie
  • bool $httponly - Make it only available on http://

Returns Eden\Cookie\Index, (*29)

Example

eden('cookie')->setData(array('foo' => 'bar'));

====, (*30)

, (*31)

setSecure

Sets a secure cookie., (*32)

Usage

eden('cookie')->setSecure(*string $key, scalar $data, int $expires, string $path, string|null $domain);

Parameters

  • *string $key - Cookie name
  • scalar $data - The data
  • int $expires - Expiration
  • string $path - Path to make the cookie available
  • string|null $domain - The domain

Returns Eden\Cookie\Index, (*33)

Example

eden('cookie')->setSecure('foo');

====, (*34)

, (*35)

setSecureData

Sets a set of secure cookies., (*36)

Usage

eden('cookie')->setSecureData(*array $data, int $expires, string $path, string|null $domain);

Parameters

  • *array $data - The list of cookie data
  • int $expires - Expiration
  • string $path - Path to make the cookie available
  • string|null $domain - The domain

Returns Eden\Cookie\Index, (*37)

Example

eden('cookie')->setSecureData(array('foo' => 'bar'));

====, (*38)

, (*39)

Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing., (*40)

Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. Fire up your local terminal create a new branch from the v4 branch of your fork with a branch name describing what your changes are. Possible branch name types:
    • bugfix
    • feature
    • improvement
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

The Versions

13/11 2015

dev-master

9999999-dev http://eden-php.com

Client side persistent data

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/11 2015

4.x-dev

4.9999999.9999999.9999999-dev http://eden-php.com

Client side persistent data

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/10 2015

4.0.1

4.0.1.0 http://eden-php.com

Client side persistent data

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

09/10 2015

3.0.0

3.0.0.0 http://eden-php.com

Client side persistent data

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

09/10 2015

4.0.0

4.0.0.0 http://eden-php.com

Client side persistent data

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden