Session constructor

Session({
  1. required Server server,
  2. String? authenticationKey,
  3. HttpRequest? httpRequest,
  4. WebSocket? webSocket,
  5. required bool enableLogging,
})

Creates a new session. This is typically done internally by the Server.

Implementation

Session({
  required this.server,
  String? authenticationKey,
  HttpRequest? httpRequest,
  WebSocket? webSocket,
  required this.enableLogging,
}) {
  _startTime = DateTime.now();

  auth = UserAuthentication._(this);
  storage = StorageAccess._(this);
  messages = MessageCentralAccess._(this);

  // ignore: deprecated_member_use_from_same_package
  db = DatabaseLegacy(session: this);
  dbNext = Database(session: this);

  sessionLogs = server.serverpod.logManager.initializeSessionLog(this);
  sessionLogs.temporarySessionId =
      serverpod.logManager.nextTemporarySessionId();
}