F
Flint DartDocs
GitHub

API Reference

Session

Focused reference for Flint Dart and Flint UI APIs, with copyable examples and practical notes.

Session

Session management with memory, file, or DB storage.

SessionManager()

Singleton session manager configured via SESSION_DRIVER.

Future<String> ctx.req.startSession(Map<String, dynamic> data, {Duration? ttl})

Create a session and set the FLINTSESSID cookie.

Future<Map<String, dynamic>?> ctx.req.session

Read session data for the current request.

Future<void> ctx.req.destroySession()

Destroy the current session and clear the cookie.

Example

CodeBlock dart
app.post('/session', (Context ctx) async {
  await ctx.req.startSession({'id': 'user-1', 'role': 'admin'});
  return ctx.res.json({'ok': true});
});
F
Flint DartBackend framework and Dart UI docs

Build routes, controllers, APIs, docs, and browser UI from one Dart-shaped stack.

Controllers
OpenAPI
Flint UI
Copyright 2024 Flint Dart. Maintained by Eulogia Technologies.
v 1.1.14
MIT License
Built with Dart