Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansott/psr7-cookies
🍪 bakes cookies for PSR-7 messages
https://github.com/hansott/psr7-cookies
cookies http php psr-7
Last synced: 6 days ago
JSON representation
🍪 bakes cookies for PSR-7 messages
- Host: GitHub
- URL: https://github.com/hansott/psr7-cookies
- Owner: hansott
- License: mit
- Created: 2016-06-21T19:30:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T17:33:37.000Z (11 months ago)
- Last Synced: 2025-01-16T23:04:26.724Z (14 days ago)
- Topics: cookies, http, php, psr-7
- Language: PHP
- Homepage: https://hansott.github.io
- Size: 492 KB
- Stars: 40
- Watchers: 2
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# ![PSR-7 Cookies](art/psr7-cookies.jpg)
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Supported PHP versions][ico-php-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Software License][ico-license]](LICENSE.md)## Install
Via Composer
``` bash
$ composer require hansott/psr7-cookies
```## Usage
### Add cookie to Psr\Http\Message\ResponseInterface
```php
modify('tomorrow');
$cookie = SetCookie::thatExpires('name', 'value', $tomorrow);// Add the cookie to a response
$responseWithCookie = $cookie->addToResponse($response);
```## Testing
``` bash
$ composer test
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
## Security
If you discover any security related issues, please email **hans at iott consulting** instead of using the issue tracker.
## Credits
- [Hans Ott][link-author]
- [All Contributors][link-contributors]## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/hansott/psr7-cookies.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/hansott/psr7-cookies.svg?style=flat-square
[ico-php-version]: https://img.shields.io/packagist/php-v/hansott/psr7-cookies.svg?style=flat-square[link-packagist]: https://packagist.org/packages/hansott/psr7-cookies
[link-downloads]: https://packagist.org/packages/hansott/psr7-cookies
[link-author]: https://github.com/hansott
[link-contributors]: ../../contributors