using cookie for session restore