Fixed bug on getting cookies