Reworking to integrate cookies - Not complete