Code:
#!/usr/local/bin/php
Did you add the above line yourself? Because the above line is not in the script you got from us.
The problems you get are not cookie related, they are because of this line:
Code:
#!/usr/local/bin/php
To be able to run cookie passwor dprotection you must remove that line. If you web hosting company do not allow you to remove that line you should move your web page to some one else.