gflare/session

Types

pub type SessionConfig {
  SessionConfig(
    cookie_name: String,
    kv_name: String,
    ttl: Int,
    secure: Bool,
    same_site: cookie.SameSite,
  )
}

Constructors

  • SessionConfig(
      cookie_name: String,
      kv_name: String,
      ttl: Int,
      secure: Bool,
      same_site: cookie.SameSite,
    )
pub type SessionData {
  SessionData(id: String, data: List(#(String, String)))
}

Constructors

  • SessionData(id: String, data: List(#(String, String)))

Values

pub fn default_config(kv_name: String) -> SessionConfig
pub fn get(
  request: request.HttpRequest,
) -> Result(SessionData, String)
pub fn get_value(
  session: SessionData,
  key: String,
) -> option.Option(String)
pub fn remove_value(
  session: SessionData,
  key: String,
) -> SessionData
pub fn save(
  response: response.Response,
  session: SessionData,
) -> response.Response
pub fn set_value(
  session: SessionData,
  key: String,
  value: String,
) -> SessionData
Search Document