in reply to Re^4: Weird CGI behaviour on different Browsers - Apache
in thread Weird CGI behaviour on different Browsers - Apache

Yes, it's a possibility that your script is executing twice. You said in the OP "the exit is getting ignored" - that is such an unlikely bug that it's practically impossible. So you need to keep track of the state to detect and prevent multiple executions of the script.

Perhaps it's time to develop a test case that reproduces the problem, like a few really short CGI scripts that redirect to each other, similar to what your code is doing now. Post it here so we can help you debug, otherwise we're left guessing and all the debugging is up to you.

  • Comment on Re^5: Weird CGI behaviour on different Browsers - Apache

Replies are listed 'Best First'.
Re^6: Weird CGI behaviour on different Browsers - Apache
by Yaerox (Scribe) on Aug 04, 2015 at 12:48 UTC
    Okay, I just got another good idea of someone else using a CONSTRAINT on the database, because server log will tell me where in my script, then I can face how often and if why it's getting executed more then once. If I won't come to an conclusion I'll go for the test-script creation.

      Using the database is one way to track the state, and if all this script is doing is manipulating the database, it's probably the best way to do so. You may want to look into transactions as well.