Skip to content

[HttpFoundation] PdoSessionHandler should connect to database only if session required #9029

Closed
@tgabi333

Description

@tgabi333

PdoSessionHandler gets its PDO connection via constructor parameter and there is a known PDO behavior that it connects to database at instantiation.

This cause a bad application behavior that every request opens a connection to database and authorize db user even if there is no need to create a session. (Think about a site which requires sessions rarely)

This is not a case when using Memcached or Mongodb because they have the ability to connect on demand.

I have a PR in progress, but first i'd like to get a confirmation to continue the work with unit tests and documentation too.

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