Session

The application session.

type Session

Create

Create an anonymous session.

Query

avatar : Session -> Avatar

Return the user avatar.

Return the session credentials if authenticated.

username : Session -> Maybe Username

Return the session username if authenticated.

Persistence

decoder : Decoder (Cred -> Session)
store : Session -> Cmd msg

Store the session into local storage.

onChange : (Session -> msg) -> Sub msg

An event listener for Session changes. It will trigger for any change of the session stored into the local storage, even those from other browser tabs or windows.