minor
Authenticate session only if  is authenticated (logged in)
minor
Introduced application level exception logger
Cache key: sha512 is overkill, replaced with (faster) md5