Docs Menu

endSessions

On this page

  • Definition
  • Behavior
  • Access Control
endSessions

New in version 3.6.

The endSessions command expires the specified sessions. The command overrides the timeout period that sessions wait before expiring.

endSessions has the following syntax:

{ endSessions: [ { id : <UUID> }, ... ] } )

To run endSessions, use the db.runCommand( { <command> } ) method.

db.runCommand( { endSessions: [ { id : <UUID> }, ... ] } )

MongoDB concatenates each of the specified UUIDs with the hash of the authenticated user credentials to identify the user's sessions to end. If the user has no session that match, the endSessions has no effect.

If the deployment enforces authentication/authorization, you must be authenticated to run the endSessions command.

A user can only end sessions belonging to the user.

Tip
See also:
Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.

About

  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.