Implement client side logic for handling expiration of sessions.

XXX this requires logic also in the backend to return a proper data structure
to support expiration.

This is in reference to https://github.com/globaleaks/GlobaLeaks/issues/603