App::getSession

Usage

?AuthSession App::getSession()

Description


Return Value

If authenticated will return an instance of the [AuthSession](https://github.com/apexpl/armor/blob/master/docs/auth_session.md), and otherwise if not authenticated will return null.

Examples

Get Session


if (!session = $app->getSession()) { throw new Exception("You are not logged in"); } echo "Session ID: " . $session->getId();

See Also