Skip to content

Access Session from the KernelBrowser #46023

@Grafikart

Description

@Grafikart

Description

When using the WebTestCase there is no way to access the session used by the loginUser() method here (https://github.com/symfony/framework-bundle/blob/5.4/KernelBrowser.php#L145).

It's hard to add new information to the session for specific use case (csrf for instance). A way to access the session would simplify the work with the client. It's not possible to use RequestStack since the request is not yet initialized.

Example

$this->client->loginUser($user);
$this->client->getSession(); // Session

Why

With the deprecation of the SessionInterface service, there is no way to access the Session that will be sent when doing requests with the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BrowserKitDXDX = Developer eXperience (anything that improves the experience of using Symfony)HttpFoundationKeep open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy