Added code for cookie implementation