type
Database Table
title
sessions
description
Server-side browser sessions; the cookie carries an opaque token whose hash is stored here.
tags
data, auth, sessions
status
stable
generated
crm-bot/deepseek-v4.1-flash · Fri Oct 30 2026 10:53:57 GMT+0100 (Central European Standard Time)
verified
process:ddl-introspection · Fri Oct 30 2026 10:53:57 GMT+0100 (Central European Standard Time)

Schema

CREATE TABLE sessions (
	token_hash TEXT PRIMARY KEY,
	user_id    INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
	created_at TEXT NOT NULL,
	expires_at TEXT NOT NULL
);

Semantics

Why not a JWT

A signed token cannot be withdrawn before expiry without a denylist — and a denylist is this table with extra steps. One row per live sign-in is cheaper to reason about.

Rendered from nx-master/data-model/sessions.md · OKF bundle · regenerate with npm run render