Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\Driver\Session::__constructMongoDB\Driver\Session::getClusterTime>
^MongoDB\Driver\SessionLast updated: Mon, 26 Oct 2026

MongoDB\Driver\Session::endSession

(mongodb >=1.5.0)

MongoDB\Driver\Session::endSession — Terminates a session

Description

final public function 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

This function has no parameters.

Return Values

No value is returned.

Errors/Exceptions

See Also


<MongoDB\Driver\Session::__constructMongoDB\Driver\Session::getClusterTime>
^MongoDB\Driver\SessionLast updated: Mon, 26 Oct 2026