form validation and cookies working