Skip to content

PHPPlatform/web-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4606481 · Aug 13, 2017

History

17 Commits
Jun 13, 2017
Jun 10, 2017
Aug 13, 2017
Jul 20, 2017
Jun 8, 2017
Jun 8, 2017
Aug 13, 2017
Jun 8, 2017
Jun 13, 2017
Jun 13, 2017
Jun 11, 2017
Jul 20, 2017
Jun 10, 2017

Repository files navigation

PHP Platforms Web Session Implementation

This packages implements the Session interface from php-platform/session package for web

build status coverage report

Introduction

A session can be created for a web application or can be for command lines This package implements the Session for web

Usage

confugure PhpPlatform\WebSession\Session as the session.class in php-platform/session config.json

{
    "session":{
        "class":"PhpPlatform\\WebSession\\Session"
    }
}

Configuration

salt

salt is used to encrypt session file name from actual session id

$sessionFileName = md5($salt.$sessionId);

path

path is the uri path on which this session cookie must be set, this value is sent as Set-Cookie's path parameter

timeout

Session timeout in seconds , this value is used to calculate Set-Cookie's expires and Max-Age parameters

name

name of the session , this is the cookie name sent to the client

sessionFilePrefix

this is the prefix for session file names for this application , since all the session files are stored in same directory , this helps to categories the session files for each application

Scripts

delete-expired-sessions

to delete the expired session files , run this script (manually or in a cron job) in regular intervals

$ ./vendor/bin/delete-expired-sessions