Skip to content

Support generating mercure URL and token directly in Twig #122

Description

@alex-dev

Using eventsource as a polyfill supporting headers for SSE, we can avoid issues with cookies.

  • As cookies are shared between tabs, opening multiple tabs for different tasks will cause race conditions and break some mercure connections
  • As cookies in the bundle don't allow configuring samesite, it is more code to support non strict modes
  • As Symfony 5 doesn't even support cookie partitionning, using mercure in a iframe on a third party domain is impossible.

I suggest adding two methods to Twig extension: mercure_url and mercure_token. Both would not trigger cookie creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions