OxL Справочник OxL
РусскийEnglish

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✓ проверяется в 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")
}
Вывод
done
pub(api) fn endSession(id: str) -> () | SessionError  db

С версии. 1.0.0-beta

Параметры

ИмяТип
idstr

Возвращает

()

Ошибки

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

Эффекты

db

Определено в: std/rpc/rpc.oxl:430

См. также