When I want to redirect a user I use the <meta> tag http-equiv=refresh - it's never given me any trouble. I would have your script write your cookie function and when it returns send the browser one of these: <meta http-equiv="refresh" content="0;url=http://redirect.url.here?anycgi=options&here=too">