Fix cookie retrieval