PHPackages                             perlucas/clientsessionstate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. perlucas/clientsessionstate

ActiveLibrary

perlucas/clientsessionstate
===========================

Simple PHP Client Session State Implementation

00[1 PRs](https://github.com/perlucas/clientsessionstate/pulls)PHPCI passing

Since Dec 14Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/perlucas/clientsessionstate)[ Packagist](https://packagist.org/packages/perlucas/clientsessionstate)[ RSS](/packages/perlucas-clientsessionstate/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Client Session State
====================

[](#client-session-state)

Simple client session state PHP implementation for embedding the session data inside the HTML content of your web pages.

Installation
------------

[](#installation)

Just run `composer require perlucas/clientsessionstate`

Fundamentals &amp; Basic Usage
------------------------------

[](#fundamentals--basic-usage)

This is one of many kinds of implementing the [client session state pattern](https://dzone.com/articles/practical-php-patterns/practical-php-patterns-client "client session state pattern"). Basically it consists on storing the session state on the client side by sending the data as an URL parameter or hiding it on a form; then restoring it on the server side for using it. [Here](http://www.rodsonluo.com/client-session-vs-server-session "Here") you can see a comparison between client session state and server session state. Use this helper for storing non-sensitive data on your HTML markup, releasing that memory usage on your server. Typically, you start by requiring an instance of `ClientSession`, and setting up your encryption key by calling the *setEncodingKey* method. After that, you can start adding, retrieving and removing values from the session object. Take into account that it works in a key-pair format.

```
