fix session length set multiple times. fixes YASP-253
clear cache on exception only if cache was initialized
fix cache path