read abstract method

FutureOr<Session> read(
  1. Request request,
  2. String name
)

Reads an existing session or creates a new one if it does not exist.

This method retrieves a session associated with the given request and session name. If a session exists, it's loaded; otherwise, a new session is created.

The request object provides context, including cookies or headers used to identify the session. The name parameter uniquely identifies the session.

Returns a Future<Session> that completes with the loaded or newly created Session object.

Example:

final session = await store.read(request, 'my_session');

Implementation

FutureOr<Session> read(Request request, String name);