store last visited state in a cookie