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")
}Output
done
pub(api) fn endSession(id: str) -> () | SessionError dbSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
id | str |
Returns
()
Errors
SessionError@error- `SessionError` when the session store cannot be written.
Effects
db
Defined in: std/rpc/rpc.oxl:430