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

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: about 1 month ago
JSON representation

:cookie: Helper class for accessing Nette session and session sections outside presenters.

Awesome Lists containing this project

README

          

# Drago Sessions

A helper package for managing sessions outside the presenter in Nette Framework.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/drago-ex/sessions/blob/master/license)
[![PHP version](https://badge.fury.io/ph/drago-ex%2Fsessions.svg)](https://badge.fury.io/ph/drago-ex%2Fsessions)
[![Tests](https://github.com/drago-ex/sessions/actions/workflows/tests.yml/badge.svg)](https://github.com/drago-ex/sessions/actions/workflows/tests.yml)
[![Coding Style](https://github.com/drago-ex/sessions/actions/workflows/coding-style.yml/badge.svg)](https://github.com/drago-ex/sessions/actions/workflows/coding-style.yml)

## Requirements
- PHP >= 8.3
- Nette Framework
- Composer

## Installation
```
composer require drago-ex/sessions
```

## Extension Registration
In your `neon` configuration, register the `ExtraSession` service:
```neon
service:
- Drago\Http\ExtraSession(@Nette\Http\Session, 'namespace')
```

## Examples
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');
```

## 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))