Skip to content

MongoDbSessionHandler.php does not support new PHP MongoDB Extension #19183

Closed
@omanizer

Description

@omanizer

This file depends on the Mongo, MongoClient, MongoId, MongoDate, and MongoBinData classes that are no longer present in the new MongoDB extension, see here

I've made this gist that utilizes the new classes.

Steps to reproduce this issue:

  1. Create & Load a session that is stored in MongoDB using the original PHP MongoDB driver
  2. Observe that the session is created and loaded as expected
  3. Uninstall the Mongo extension in PHP and install the MongoDB extension in it's place.
  4. Create a session and attempt to store it in MongoDB
  5. Observe that this process fails with the error MongoClient or Mongo instance required. This exception is found on Line 73 of Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler.

I'd suggest modifying this file to have the ability to work with both PHP extensions depending on which classes exist.

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