finishes implementing session cache.