Session constructor

Session({
  1. required Server server,
  2. String? authenticationKey,
  3. Duration maxLifeTime = const Duration(minutes: 1),
  4. HttpRequest? httpRequest,
  5. WebSocket? webSocket,
  6. String? futureCallName,
  7. required bool enableLogging,
})

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

Implementation

Session({
  required this.server,
  String? authenticationKey,
  this.maxLifeTime = const Duration(minutes: 1),
  HttpRequest? httpRequest,
  WebSocket? webSocket,
  String? futureCallName,
  required this.enableLogging,
}) {
  _startTime = DateTime.now();

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

  db = Database(session: this);

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