Adding support for timeouts and session caching.