Cleanup error handling
Add Cookie visibility control.