Skip to content

joefallon/phpsession

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpsession

By Joe Fallon

This library has the following features:

  • Fully unit tested.
  • Does not keep the session open between reads and writes. This allows AJAX requests to not be blocked.
  • Simple to use. Can be fully understood in a matter of minutes.
  • Allows a maximum age to be used for session invalidation.
  • Allows a maximum inactivity time to be used for session invalidation.

Installation

The easiest way to install PHP Scalars is with Composer. Create the following composer.json file and run the php composer.phar install command to install it.

{
    "require": {
        "joefallon/phpsession": "*"
    }
}

Usage

$foo     = 'bar';
$session = new Session();
$session->write($foo, 'value');
$session->read($foo);   // value

The Session class contains the following methods:

__construct($maxAgeInSecs = 1800, $lastActivityTimeoutInSecs = 1800)
read($key)
write($key, $val)
unsetSessionValue($key)
maxAgeTimeoutExpired()
lastActivityTimeoutExpired()
destroy()

About

A simple age and activity based session library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages