Remove duplicated Cookie management code to keep codebase DRY.