mrsuh / nginx-session-handler
Nginx session handler
Installs: 2 824
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2
- predis/predis: >=1
- snc/redis-bundle: >=3
- symfony/security-core: >=4
README
This bundle integrates predis and snc/redis-bundle into your Symfony 3/4 application So, you need to configure the bundles too.
Installation
Add the nginx-session-handler package to your require section in the composer.json file.
composer require mrsuh/nginx-session-handler:2.*
Add the NginxSessionHandlerBundle to your application's kernel (Symfony 3):
<?php public function registerBundles() { $bundles = array( // ... new Mrsuh\NginxSessionHandlerBundle\MrsuhNginxSessionHandlerBundle(), // ... ); ... }
Configure the session
in your config.yml
:
framework: session: handler_id: mrsuh.session_handler mrsuh_nginx_session_handler: session_lifetime: 3600 session_prefix: phpsession
Add session.lua
script to your nginx.conf
location /security { content_by_lua_file session.lua; }
Now your php session locate in redis. Your location /security
allow for authenticated users with role ROLE_ADMIN only.