| 0024ccb1 Andy McCall ↶ | 1 | -- Sessions as server-side records (oxygenhub#223). The cookie holds a |
| 2 | -- random id; only its hash is kept here. A session is good while its salt |
|
| 3 | -- matches the account's (a new password or "sign out everywhere" ends them |
|
| 4 | -- all), it has been used in the last 14 days, and it is under 30 days old. |
|
| 5 | ( |
|
| 6 | id INTEGER PRIMARY KEY, |
|
| 7 | account_id INTEGER NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, |
|
| 8 | hash TEXT NOT NULL UNIQUE, |
|
| 9 | salt TEXT NOT NULL, |
|
| 10 | created_ms INTEGER NOT NULL, |
|
| 11 | seen_ms INTEGER NOT NULL, |
|
| 12 | address TEXT NOT NULL DEFAULT '', |
|
| 13 | agent TEXT NOT NULL DEFAULT '' |
|
| 14 | ); |
|
| 15 | ON sessions(account_id); |