Sanitise cookie value using new function.