php8.5
Home/ Manual/ driver / session/ MongoDB\Driver\Session::endSession

MongoDB\Driver\Session::endSession

PHP function Edit on GitHub ✎

(mongodb >=1.5.0)

Terminates a session

Description

MongoDB\Driver\Session::endSession(): void

This method closes an existing session. If a transaction was associated with this session, the transaction will be aborted. After calling this method, applications should not invoke other methods on the session.

Note

Sessions are also closed during garbage collection. It should not be necessary to call this method under normal circumstances.

Parameters Parameters

Return Values

Void

Errors/Exceptions

See Also

  • MongoDB\Driver\Manager::startSession
  • MongoDB\Driver\Session::abortTransaction
  • MongoDB\Driver\Session::commitTransaction
  • MongoDB\Driver\Session::startTransaction

Source: reference/mongodb/mongodb/driver/session/endsession.xml · from the official PHP manual (php/doc-en)