Validation fail

If the initial request URL doesn't finish with a / , for example http://twitter.com then any cookies set by it are rejected as the request_path variable will be empty and so never match the cookie path.

I also think that as you are going to the effort of building up an errors array then you should somehow return it in some way so the developer can chose to view it to work out what is wrong with the cookies being set.
Missing space after #.