Allow setting the session, to restore from a previous session.

After that we can call refreshSession to continue a previous session that we have stored manually.