Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asdfdotdev/session
PHP session helper.
https://github.com/asdfdotdev/session
composer-package php-sessions php72 php73 php74 php8
Last synced: about 1 month ago
JSON representation
PHP session helper.
- Host: GitHub
- URL: https://github.com/asdfdotdev/session
- Owner: asdfdotdev
- License: lgpl-2.1
- Created: 2015-01-04T04:32:43.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2022-02-26T17:59:32.000Z (over 2 years ago)
- Last Synced: 2024-09-29T19:42:22.063Z (about 2 months ago)
- Topics: composer-package, php-sessions, php72, php73, php74, php8
- Language: PHP
- Homepage:
- Size: 102 KB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/funding.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Session
![PHPUnit Tests (8.x)](https://github.com/asdfdotdev/session/workflows/PHPUnit%20Tests%20(8.x)/badge.svg) ![PHPUnit Tests (7.x)](https://github.com/asdfdotdev/session/workflows/PHPUnit%20Tests%20(7.x)/badge.svg) [![codecov](https://codecov.io/gh/asdfdotdev/session/branch/main/graph/badge.svg)](https://codecov.io/gh/asdfdotdev/session) [![Packagist](https://img.shields.io/packagist/dm/asdfdotdev/session)](https://packagist.org/packages/asdfdotdev/session)
This class endeavors to make it easy to use better sessions in PHP scripts.
* Easily set, increment, append, hash, and drop session values
* Custom session naming
* Simple session fingerprint check
* Regenerate session id at random intervals
* Change session id length & bits per character*
* HTTPOnly session cookie
* Decoy PHPSESSID cookie
* Force session strict mode*
* Force session use only cookies*
* Force HTTPS only session cookies*
* Supports PHP 7.2+\* Requires `ini_set()` method be enabled.
### Compatibility
[![PHP Compatibility](https://img.shields.io/badge/PHP-7.2_to_8.1-%238892BF.svg?logo=php)](https://php.net/)
Session class is developed for and tested with recent PHP Version:
- PHP 7.2, 7.3, 7.4, 8.0, 8.1
## Installation
```
composer require asdfdotdev/session
```## Use
A number of usage examples are included in `_examples/`. Check out the examples [README](./_examples/README.md) for further details.
## Tests
Information regarding the included tests is available in the tests the [README](./_test#readme).
[Build history can be browsed at GitHub.](https://github.com/asdfdotdev/session/actions)
## Standards
This class follows [PSR-12](https://www.php-fig.org/psr/psr-12/) code standards.
## Debugging
By default basic checks are performed when creating a session:
- **Session Lifespan:** Prevents min lifespan from being greater than max lifespan.
- **System Timezone:** Confirms default timezone is configured for PHP, if not UTC is set.Additional optional debugging can be enabled in session settings:
- **PHP Version:** Confirms the version available is 7.2.0 or newer
- **Session Directory:** Confirms write access to PHP session directory
- **Session Domain:** Confirms session domain setting matches the request domain## Contributing
Feedback, bug reports, feature requests, and pull requests are welcome!
If you'd like to contribute please reference our [code of conduct](./.github/CODE_OF_CONDUCT.md) and [contributing](./.github/CONTRIBUTING.md) guides.