Download the PHP package timefrontiers/php-session without Composer
On this page you can find all versions of the php package timefrontiers/php-session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download timefrontiers/php-session
More information about timefrontiers/php-session
Files in timefrontiers/php-session
Package php-session
Short Description Modern PHP session manager with authentication state, access control, and CSRF protection
License MIT
Homepage https://github.com/timefrontiers/php-session
Informations about the package php-session
TimeFrontiers PHP Session
Modern PHP session manager with authentication state, access control, CSRF protection, and geolocation.
Installation
Features
- Secure session handling with HTTPOnly, SameSite cookies
- User authentication state management
- Access rank/group based authorization
- CSRF token generation and validation
- Flash messages
- IP geolocation integration
- PSR-3 logger support
Quick Start
Authentication
Login
Note: "Remember me" / persistent login requires storing a token in your database and is intentionally left to the application layer.
Logout
Check Authentication
Access Control
CSRF Protection
Generate Token
Or use the helper:
Validate Token
Tokens are single-use and automatically expire (default: 1 hour). Expired tokens from other forms are pruned automatically on each generateCSRFToken() call.
User Object Storage
set(), get(), has(), and remove() operate on the authenticated user object and are persisted to the session. Use these to attach extra data to the user mid-session.
Flash Messages
Flash messages persist for one request only.
Session Expiry
Geolocation
Requires timefrontiers/php-location:
Logging
Pass a PSR-3 logger for session events:
Error Handling
Session uses static error collection for compatibility with InstanceError:
Security Features
- Session ID regeneration on login (prevents fixation)
- Secure cookies (HTTPOnly, SameSite=Lax)
- HTTPS-only cookies when available
- Timing-safe CSRF token comparison (
hash_equals) - Single-use CSRF tokens with automatic expiry pruning
- No session ID regeneration on every request (prevents concurrency issues)
Dependencies
psr/log- For PSR-3 logger interfacetimefrontiers/php-core- For AccessRank and AccessGroup enumstimefrontiers/php-instance-error- For error extraction
Optional Dependencies
timefrontiers/php-location- For IP geolocation
License
MIT
All versions of php-session with dependencies
psr/log Version ^3.0
timefrontiers/php-core Version ^1.0
timefrontiers/php-instance-error Version ^1.0