When succes on Login the email is passed to the session (see below). I also want the ID to pass to this session, how to do this? And how to acces that var inside a view of in Layout?
if ($bcrypt->verify($this->password, $passwordHash)) {
// Great! The password hash matches. Return user identity (email) to be
// saved in session for later use.
return new Result(
Result::SUCCESS,
$this->email,
['Authenticated successfully.']);
}