Instead of retrieving the permission from the session cookie, store permission data from /session/, and cache it in a cookie. On subsequent page loads, the permission information will be retrieved from the cookie more quickly than the /session/ endpoint returns. When the session changes, the cookie and permissions state is updated to reflect the new state.
Before, if a cookie didn't exist, it would throw an error, not causing permissions/tokens to change to empty values. This fixes that (and #626) by setting the value to undefined instead.
Assumes the session cookie is stored as JSON which may or may not have been compressed via zlib (indicated by a leading `.`), which is then base64-encoded, and made URL-safe by replacing all `+` and `/` characters with `-` and `_` respectively.
isolate cookie business logic from react mixin logic so that they are more modular. And use the cookie business logic to set translation objects on the window