Download the PHP package byjg/jwt-session without Composer
On this page you can find all versions of the php package byjg/jwt-session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download byjg/jwt-session
More information about byjg/jwt-session
Files in byjg/jwt-session
Package jwt-session
Short Description A PHP session replacement that stores session data in JWT tokens instead of the filesystem. This implementation follows the SessionHandlerInterface standard, enabling stateless sessions without the need for dedicated session servers like Redis or Memcached. Perfect for distributed applications and microservices architectures.
License MIT
Informations about the package jwt-session
sidebar_key: jwt-session tags: [php, cryptography, authentication]
JWT Session Handler
A PHP session replacement that stores session data in JWT tokens instead of the filesystem. This implementation follows the SessionHandlerInterface standard, enabling stateless sessions without the need for dedicated session servers like Redis or Memcached. Perfect for distributed applications and microservices architectures.
Documentation
- Getting Started - Installation, basic usage, and motivation
- Configuration - Session timeout, contexts, cookies, and all configuration options
- RSA Keys - Using RSA private/public keys for enhanced security
- How It Works - Architecture and internal implementation details
- Security - Security considerations and best practices
- API Reference - Complete API documentation for all classes and methods
How to use:
Before the session_start() use the command:
Now, all your $_SESSION variable will be saved directly to a JWT Token!!
Note: Make sure that you are providing a base64url encoded key.
For more details on motivation, security considerations, and best practices, see the Documentation section above.
Install
Configuration Examples
Setting the validity of JWT Token
Setting different Session Contexts
For complete configuration options including cookie domains and automatic session handler replacement, see Configuration.
Using RSA Private/Public Keys
For more details about RSA keys and how to generate them, see https://github.com/byjg/jwt-wrapper