Added cookie handling functions to the controller module