Restore caching of credentials in session. Update credentials when context is updated. Add credentials to events.