Add a trim function for multi cookies