Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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