fastpress / session
A robust and flexible session management library for PHP, optimized for use with the Fastpress framework. Provides secure handling of session data with an easy-to-use interface.
Requires
- php: ^7.4 || ^8.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2024-11-06 19:59:48 UTC
README
Fastpress\Session is a modern, secure, and easy-to-use session management library for PHP. Crafted with simplicity and efficiency in mind, it seamlessly integrates with the Fastpress framework, yet remains flexible enough to be used in any PHP project. Whether you're building a small website or a large-scale application, Fastpress\Session provides a robust solution for handling session data securely and effectively.
Features
- Simple and intuitive API: Easy to use methods for session manipulation.
- Flash messages support: Conveniently handle one-time messages for user feedback.
- Secure session handling: Enhanced security features to prevent common vulnerabilities.
- Flexible configuration: Customize session behavior to fit your application's needs.
- PSR-4 autoloading: Fully compliant with modern PHP standards.
Installation
Use Composer to install Fastpress\Session into your project:
composer require fastpress/session
Requirements
- PHP 7.4 or higher.
Usage
Setting Session Data
use Fastpress\Security\Session; $session = new Session(); $session->start();
Setting Session Data
$session->set('username', 'JohnDoe');
Retrieving Session Data
$username = $session->get('username');
Flash Messages
// Set a flash message $session->setFlash('success', 'You have successfully logged in.'); // Retrieve and clear the flash message $message = $session->getFlash('success');
Destroying a Session
$session->destroy();
Contributing
Contributions are welcome! Please feel free to submit a pull request or open issues to improve the library.
License
This library is open-sourced software licensed under the MIT license.
Support
If you encounter any issues or have questions, please file them in the issues section on GitHub.