Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpFoundation] custom attribute/flash bag registration #41443

Copy link
Copy link
Closed
@kbond

Description

@kbond
Issue body actions

Description
With the deprecation of the session service, I'm trying to figure out how to register custom attribute/flash bags (via SessionInterface::registerBag()) in 5.3+.

I'm not sure if this is the best practice but the common way of doing this pre-5.3 seems to be a compiler pass with the following:

$container->getDefinition('session')
    ->addMethodCall('registerBag', [new Reference('my_custom_bag_service')])
;

I thought about a request listener to run right after the SessionListener (to ensure the session isn't yet started) but that would trigger the Request::$session callback perhaps unnecessarily...

If there is currently a better way that works in 5.3, I can add this to the docs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.