Make cookie generic so it can be use elsewhere