Skip to content

Sessions

$bolt.setSession(cKey, cValue)

Set session value.

$bolt.setSession("user_id", "123")
$bolt.setSession("role", "admin")

$bolt.getSession(cKey)

Get session value.

userId = $bolt.getSession("user_id")

$bolt.deleteSession(cKey)

Delete session key.

$bolt.deleteSession("user_id")

$bolt.clearSession()

Clear all session data.

$bolt.clearSession()

$bolt.setFlash(cKey, cValue)

Set flash message (one-time session data).

$bolt.setFlash("success", "User created!")

$bolt.getFlash(cKey)

Get and clear flash message.

msg = $bolt.getFlash("success")

$bolt.hasFlash(cKey)

Check if flash message exists.

if $bolt.hasFlash("error")
    # ...
ok