yeah i already made a comment that the script does not work. I do not know why perhaps it is outdated and only used for older browsers.
at least it prints information for you. for me the file remained blank and nothing was printed.
the script I provided is very simple and works. it gives you the cookie and nothing else... which is all you really need anyways.
I am still waiting for someone to take a look at my script and figure out how to make it redirect to a new page while retaining the functionality of the script itself.
I have a feeling I should not hold my breath.