-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Symfony] Do not use Session deprecated features #10345
Comments
Because of the deprecated info, adapting the example of the docs, I simply struggle trying to register a non namespaced AttributeBag in my 10.1 bundle. I get this Exception when I try to set any value to the bag.
Where/when do I have to register the AttributeBag to be before haveing pimcore/symfony started the session? Do I need to use the pimcore SessionConfiguratorInterface or can I just use it like this:
|
@langert besides that your struggle is unrelated to this ticket: you need to register your bag via App\Session\SessionConfigurator:
tags:
- { name: pimcore.session.configurator } <?php
namespace App\Session;
use Pimcore\Session\SessionConfiguratorInterface;
use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class SessionConfigurator implements SessionConfiguratorInterface
{
public function configure(SessionInterface $session)
{
$bag = new NamespacedAttributeBag('_your_bag');
$bag->setName('your_bag');
$session->registerBag($bag);
}
} But I would suggest using the |
We are not using namespaces for session storage items in the core, so I would suggest we simply replace the |
…ony/framework-bundle requirement #10345
* [Symfony] Session - Do not use deprecated session service - resolves #10345 * [Symfony] Session - use AttributeBag instead of deprecated NamespacedAttributeBag - resolves #10345 * [Symfony] Session - Do not use deprecated session service - resolves #10345 * [Symfony] Session - Do not use deprecated session service - resolves #10345 * [Symfony] Session - Do not use deprecated session service - fix tests resolves #10345 * [Symfony] Session - Do not use deprecated session service - bump symfony/framework-bundle requirement #10345
Improvement description
\Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag
has been deprecated.We need to provide our own implementation.
See: https://symfony.com/doc/current/session.html#basic-usage
The text was updated successfully, but these errors were encountered: