drago-ex / sessions
Helper class for accessing Nette session and session sections outside presenters.
v1.0.6
2025-01-24 12:49 UTC
Requires
- php: >=8.3 <9
- nette/http: ^3.3
- nette/utils: ^4.0
Requires (Dev)
- nette/bootstrap: ^3.2
- nette/tester: ^2.5
- phpstan/phpstan-nette: ^1.2.9
- tracy/tracy: ^2.10
README
A helper package for managing sessions outside the presenter in Nette Framework.
Technology
- PHP 8.3 or higher
- composer
Features
- Provides access to Nette sessions and session sections outside the presenter.
- Ideal for managing session data in services or components within a Nette application.
Knowledge
- Sessions
Installation
composer require drago-ex/sessions
Service registration
In your neon
configuration, register the ExtraSession
service:
service: - Drago\Http\ExtraSession(@Nette\Http\Session, 'namespace')
Usage
Setting session values
// Setting a session value in the specified section. $this->ExtraSession->getSessionSection()->set('key', 'value');
Reading session values
// Getting a session value from the section. $value = $this->ExtraSession->getSessionSection()->get('key');