Cookie retrieval function added, get validation implemented