refactor, delete cookie if invalid, option to disable caching via parameter or route