in reply to cookies/redirect problem

Need to look and see if a cookie is set; if not, set it and redirect back to the URL.

You've run into a common problem, and one in which the behavior varies depending on which web server you're using.

See IIS and Apache (which discusses a workaround), or try a Super Search for "cookie redirect".