Module nakama.session

Create and check sessions.

Functions

is_token_expired_soon (session) Check whether a Nakama session token is about to expire (within 24 hours)
is_token_expired (session) Check whether a Nakama session token has expired or not.
is_refresh_token_expired (session) Check whether a Nakama session refresh token has expired or not.
create (data) Create a session object with the given data and included token.
store (session, id) Store a session on disk
restore (id) Restore a session previously stored using session.store()


Functions

is_token_expired_soon (session)
Check whether a Nakama session token is about to expire (within 24 hours)

Parameters:

  • session The session object created with session.create().

Returns:

    A boolean if the token is about to expire or not.
is_token_expired (session)
Check whether a Nakama session token has expired or not.

Parameters:

  • session The session object created with session.create().

Returns:

    A boolean if the token has expired or not.
is_refresh_token_expired (session)
Check whether a Nakama session refresh token has expired or not.

Parameters:

  • session The session object created with session.create().

Returns:

    A boolean if the refresh token has expired or not.
create (data)
Create a session object with the given data and included token.

Parameters:

  • data A data table containing a "token", "refresh_token" and other additional information.

Returns:

    The session object.
store (session, id)
Store a session on disk

Parameters:

  • session The session to store
  • id Id of the session (optional, defaults to "nakama")

Returns:

    sucess
restore (id)
Restore a session previously stored using session.store()

Parameters:

  • id Id of the session (optional, defaults to "nakama")

Returns:

    The session or nil if no session has been stored
generated by LDoc 1.5.0 Last updated 2025-10-18 15:04:29