https://github.com/drago-ex/sessions
:cookie: Helper class for accessing Nette session and session sections outside presenters.
https://github.com/drago-ex/sessions
nette sessions
Last synced: 3 months ago
JSON representation
:cookie: Helper class for accessing Nette session and session sections outside presenters.
- Host: GitHub
- URL: https://github.com/drago-ex/sessions
- Owner: drago-ex
- License: mit
- Created: 2016-02-04T08:47:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-24T13:31:14.000Z (5 months ago)
- Last Synced: 2025-01-24T13:37:33.760Z (5 months ago)
- Topics: nette, sessions
- Language: PHP
- Homepage:
- Size: 86.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
## Drago Sessions
A helper package for managing sessions outside the presenter in Nette Framework.[](https://raw.githubusercontent.com/drago-ex/sessions/master/license.md)
[](https://badge.fury.io/ph/drago-ex%2Fsessions)
[](https://github.com/drago-ex/sessions/actions/workflows/tests.yml)
[](https://github.com/drago-ex/sessions/actions/workflows/coding-style.yml)
[](https://www.codefactor.io/repository/github/drago-ex/sessions)
[](https://coveralls.io/github/drago-ex/sessions?branch=master)## 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]([https://github.com/dg/dibi](https://doc.nette.org/en/http/sessions))## Installation
```
composer require drago-ex/sessions
```## Service registration
In your `neon` configuration, register the `ExtraSession` service:
```neon
service:
- Drago\Http\ExtraSession(@Nette\Http\Session, 'namespace')
```## Usage
Setting session values
```php
// Setting a session value in the specified section.
$this->ExtraSession->getSessionSection()->set('key', 'value');
```Reading session values
```php
// Getting a session value from the section.
$value = $this->ExtraSession->getSessionSection()->get('key');
```