https://github.com/coral-media/http-foundation
Overrides and/or extend http-foundation component functionality in Symfony
https://github.com/coral-media/http-foundation
component http symfony
Last synced: 3 days ago
JSON representation
Overrides and/or extend http-foundation component functionality in Symfony
- Host: GitHub
- URL: https://github.com/coral-media/http-foundation
- Owner: coral-media
- Created: 2022-02-02T04:46:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-12T03:14:15.000Z (about 4 years ago)
- Last Synced: 2025-02-16T14:51:14.007Z (about 1 year ago)
- Topics: component, http, symfony
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http-foundation
Intended to override and/or extend [http-foundation](https://symfony.com/components/HttpFoundation)
component functionality in Symfony development environments.
## Installation and configuration
Install this package using composer.
`composer require coral-media/http-foundation`
For further configuration check following sections.
## The EncryptedSessionProxy
Provides session encrypting for our session handler. Example provided below shows how to implement it using `PdoSessionhandler`.
After installation set up your `services.yaml` as follows:
```yaml
...
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
arguments:
- '%env(resolve:DATABASE_URL)%'
session.handler.pdo:
alias: 'Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler'
CoralMedia\Component\HttpFoundation\Session\Storage\Proxy\EncryptedSessionProxy:
arguments:
- '@session.handler.pdo'
- '%env(resolve:SESSION_ENCRYPTION_KEY)%'
session.storage.proxy.encrypted:
alias: 'CoralMedia\Component\HttpFoundation\Session\Storage\Proxy\EncryptedSessionProxy'
...
```
Dont forget to add your configuration in `config/packages/framework.yaml`
```yaml
framework:
...
session:
handler_id: session.storage.proxy.encrypted
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
save_path: '%kernel.cache_dir%/sessions'
...
```