Replace the count of logouts with a random value (part of #256)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The session manager now keeps a random value from crypto/rand in the logout table, made when the table has none and replaced by each logout. A session carries the value current at its login and is refused when it differs. A lost state directory now ends every login session, and no logout can make an ended one work again, as a count starting from 0 could. README.md and the Manager doc comment say the check for a logout compares no time, while a session's expiry still compares the clock. Model: opus-5-5
This commit is contained in:
@@ -177,11 +177,10 @@ CREATE TABLE IF NOT EXISTS cache_stats (
|
||||
);
|
||||
INSERT OR IGNORE INTO cache_stats (id) VALUES (1);
|
||||
|
||||
-- Count of logouts. Each logout adds one; a login session carries the count
|
||||
-- at its login and is refused once the count has changed, so logging out ends
|
||||
-- every login session.
|
||||
-- A random value that a login session carries from its login. pixa makes it
|
||||
-- when the table has no row, and each logout replaces it; a login session
|
||||
-- carrying another value is refused, so logging out ends every login session.
|
||||
CREATE TABLE IF NOT EXISTS logout (
|
||||
id INTEGER PRIMARY KEY CHECK (id = 1),
|
||||
logout_count INTEGER NOT NULL DEFAULT 0
|
||||
logout_value TEXT NOT NULL
|
||||
);
|
||||
INSERT OR IGNORE INTO logout (id) VALUES (1);
|
||||
|
||||
Reference in New Issue
Block a user