PHPackages                             worldnewsgroup/serverless-session-handler - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. worldnewsgroup/serverless-session-handler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

worldnewsgroup/serverless-session-handler
=========================================

Enable PHP sessions using DynamoDB in Serverless

v1.0.5(2mo ago)06MITPHPPHP &gt;=8.1

Since Feb 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/bmenking-wng/serverless-session-handler)[ Packagist](https://packagist.org/packages/worldnewsgroup/serverless-session-handler)[ Docs](http://wng.org/developers)[ RSS](/packages/worldnewsgroup-serverless-session-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (0)

Serverless PHP Session Handler
==============================

[](#serverless-php-session-handler)

Provides a PHP session handler for AWS DynamoDB when hosting websites on Serverless.

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

[](#installation)

Installation is easy via [Composer](https://getcomposer.org/):

```
$ composer require worldnewsgroup/serverless-session-handler
```

or add it manually to your composer.json.

Usage
-----

[](#usage)

Create a DynamoDB table with the following defintion (serverless resource definition):

```
resources:
    Resources:
        sessionTable:
            Type: AWS::DynamoDB::Table
            Properties:
                #BillingMode: PAY_PER_REQUEST
                TableName: ${self:service}-sessions
                AttributeDefinitions:
                - AttributeName: id
                    AttributeType: S
                KeySchema:
                - AttributeName: id
                    KeyType: HASH
```

Verify the Serverless IAM roles or permissions are correct for connecting to that DynamoDB.

```
provider:
    iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb:GetItem
        - dynamodb:PutItem
        - dynamodb:DeleteItem
        - dynamodb:DescribeTable
      Resource:
        - "Fn::GetAtt": [ sessionTable, Arn ]
```

In code, set up the handler. Use the standard access methods for PHP sessions.

```
    use WorldNewsGroup\Serverless\ServerlessSession;

    require('vendor/autoload.php');
    // put as close to the top (just under the require('vendor/autoload.php') is best) as possible
    ServerlessSession::getInstance('', '');

    ...
    // set the Session variable token to 'jwt'
    $_SESSION['token'] = 'jwt';
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~182 days

Total

5

Last Release

87d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9e70ca622cd3305351aea0ab4ba07a27a678ba47aff1efff99d76614a7d1201?d=identicon)[bmenking-wng](/maintainers/bmenking-wng)

---

Top Contributors

[![bmenking-wng](https://avatars.githubusercontent.com/u/61564034?v=4)](https://github.com/bmenking-wng "bmenking-wng (12 commits)")

---

Tags

phpsessionserverless

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/worldnewsgroup-serverless-session-handler/health.svg)

```
[![Health](https://phpackages.com/badges/worldnewsgroup-serverless-session-handler/health.svg)](https://phpackages.com/packages/worldnewsgroup-serverless-session-handler)
```

###  Alternatives

[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)[rcastera/session

Session Class

222.2k](/packages/rcastera-session)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
