[DOCS-10552] Docs for SERVER-28334: Implement the startSession command Created: 19/Jul/17  Updated: 29/Oct/23  Resolved: 27/Oct/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.9

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: docs-sessions
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-28334 Implement the startSession command Closed
Related
related to DOCS-10685 Docs for SERVER-28335: Implement the ... Closed
related to DOCS-10735 Docs for SERVER-29628: Add aggregatio... Closed
related to DOCS-10835 Docs for SERVER-31174: Move the sessi... Closed
related to DOCS-10845 Docs for SERVER-28336: Implement endS... Closed
Participants:
Days since reply: 6 years, 30 weeks ago
Epic Link: DOCS: 3.6 Server

 Description   

Documentation Request Summary:

https://docs.google.com/document/d/1ROSvJYvuV8aZL663bfs4pd0-bl2Pupq-EmrhcgJ9Flw/edit#heading=h.chi90z5clxyh

startSession()

{ startSession : 1 }

This command will cause the cluster to generate and return a new session record.

If --auth is on, then exactly one user must be authenticated in order to run startSession. If this is not the case, then the command will fail with an error. Only users with adequate permissions may run startSession (see Authorization for Sessions). The user running startSession becomes the owner of the new session. In order to run future operations inside the session, on the same connection or on different connections, the session owner must be authenticated.

If --auth is not enabled, then startSession will not require a user to be authenticated in order to run. If no user is authenticated, then new sessions created via startSession will not have an owner, and may be used on any connection. If a user authenticates anyway and runs startSession, then she will own the newly created session. Because --auth is off, however, even sessions with owners may be used by any user on any connection.

If at any point --auth is turned on in the cluster, sessions without owners may not be used. Attempts to use unowned sessions for further operations will receive an Unauthorized error. Users must authenticate, create new sessions, and then use those new, owned sessions instead. If the cluster is then restarted without --auth, the original sessions without owners may once again be used.

This command may be run against any server in the cluster.

Guarantees:
New sessions will have an id that is unique within the cluster.
Servers may cache information about the new session for future operations.
The new session may subsequently be used with any server in the cluster.
All new sessions will have a fixed sessionTimeout value.
Subsequent use of a session implies liveness and extends its lifetime.

Returns:

{ "id" : <BSONObj>, // a signed logical session id "timeoutMinutes" : <int> }
Generated at Thu Feb 08 08:00:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.