OxL Reference

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:

oxl✓ checked in CI
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  db

Since. 1.0.0-beta

Parameters

NameType
idstr

Returns

()

Errors

  • SessionError @error
  • `SessionError` when the session store cannot be written.

Effects

db

Defined in: std/rpc/rpc.oxl:430

See also