fn endSession
Ends the session id (logout): later calls with its cookie are UNAUTHENTICATED (other nodes notice within a second).
An unknown id is not an error.
Example:
use std.rpc { createSession, endSession }
use std.time { Duration }
fn main() io, db {
let id = createSession("u1", [], Duration.ofMinutes(5))!
endSession(id)!
// ending it again is not an error
endSession(id)!
print("done")
}Вывод
done
pub(api) fn endSession(id: str) -> () | SessionError dbС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
id | str |
Возвращает
()
Ошибки
SessionError@error- `SessionError` when the session store cannot be written.
Эффекты
db
Определено в: std/rpc/rpc.oxl:430