Fixed several possible nil pointer access issues.
Make sure to log error.
Show warning when no handler is registered.
Store login information in mode dependent key.
Cleanup of session register code.