Checking the path of a submitted cookie will never work as the path is not sent by the browser, so will be null.