smr/src/sql/create_table_session.sql

13 lines
419 B
MySQL
Raw Normal View History

/*
Store a cookie for logged in users. Logged in users can edit
2023-05-17 23:18:24 +02:00
their own posts, edit their biographies, and post stories and comment under their own name.
TODO: WE can hash the "key" so that even if the database gets
dumped, a hacker can't cookie-steal with only read access
to the db.
*/
CREATE TABLE IF NOT EXISTS sessions (
key TEXT PRIMARY KEY,
author REFERENCES authors(id) ON DELETE CASCADE,
start INTEGER
);