I was reading this sentence and was a bit confused because it has two possible meanings:
But I want to terminate the session as soon as user closes the browser using Ajax.
— Source (scroll down to second reply)
Does he mean that he wants to close the browser by using Ajax,
or that he wants to terminate the session by using Ajax?
Is the sentence grammatically incorrect, or is it my mistake that I see more than one meaning? How could I rewrite the sentence to make it obvious?