Fix serving error page is saving cookie fails