Changed cookie to sessions