PHPackages                             diuitapi/php-session-helper - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. diuitapi/php-session-helper

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

diuitapi/php-session-helper
===========================

Diuit Session Token Helper, to make easier the session token creating process

0.1.3(10y ago)029Apache-2.0PHPPHP &gt;=5.4.0

Since Mar 7Pushed 10y ago2 watchersCompare

[ Source](https://github.com/diuitAPI/diuit.api.php-session-helper)[ Packagist](https://packagist.org/packages/diuitapi/php-session-helper)[ Docs](https://github.com/diuitAPI/diuit.api.php-session-helper)[ RSS](/packages/diuitapi-php-session-helper/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

Diuit Session Token Helper
==========================

[](#diuit-session-token-helper)

A simple PHP library to help you authenticate your devices from backend easier. It returns session token, which you have to pass to your device and login with it.

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

[](#installation)

Package is available on [Packagist](https://packagist.org/packages/diuit/diuit-session-token-helper), you can install it using [Composer](http://getcomposer.org).

```
composer require diuitapi/php-session-helper
```

### Dependencies

[](#dependencies)

- PHP 5.4+

Basic usage
-----------

[](#basic-usage)

### Getting session token

[](#getting-session-token)

Just use the DiuitTokenHelper to get a session token:

```
use Diuit\DiuitTokenHelper;

$session = (new DiuitTokenHelper())->setAppId('your_app_id') // Configures app ID
                        ->setAppKey('your_app_key') // Configures app key
                        ->setKeyID('your_key_id') // Configures key id for finding public key
                        ->setPrivateKey('file://your_pem_file_path') // Configures private key (you can either use file path or plain text)
                        ->setUserSerial('user_serial') // Configures user serial
                        ->setExpDuration(7*24*3600) // Configures length of session valid duration (in seconds), example is in length of a week
                        ->getSessionToken('your_device_serial', 'gcm', 'device_push_token'); // Configures device serial, platform and push token(optional) and retrieves session token

echo $session; // will print session token
```

### And then ... ?

[](#and-then--)

Pass the **session token** you got here to your client (may be an app or browser), and login your client with it for using more features of [Diuit Messaging API](http://api2.diuit.com/).

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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 ~0 days

Total

2

Last Release

3666d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/851ab2983803ee338d24eaab25b5c23f2d288a5521802f4805889acc2bffeee8?d=identicon)[pofat](/maintainers/pofat)

---

Top Contributors

[![pofat](https://avatars.githubusercontent.com/u/4652318?v=4)](https://github.com/pofat "pofat (8 commits)")

---

Tags

jwtdiuit

### Embed Badge

![Health badge](/badges/diuitapi-php-session-helper/health.svg)

```
[![Health](https://phpackages.com/badges/diuitapi-php-session-helper/health.svg)](https://phpackages.com/packages/diuitapi-php-session-helper)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k48.3M315](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8299.4M43](/packages/php-open-source-saver-jwt-auth)[sizeg/yii2-jwt

JWT based on Icobucci

196984.3k5](/packages/sizeg-yii2-jwt)[bizley/jwt

JWT integration for Yii 2

67409.2k2](/packages/bizley-jwt)[hyperf-ext/jwt

The Hyperf JWT package.

53132.9k2](/packages/hyperf-ext-jwt)[maicol07/flarum-ext-sso

SSO for Flarum

468.2k](/packages/maicol07-flarum-ext-sso)

PHPackages © 2026

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