Duplicate request issued in ZF when using inline script/document.writeln in view

This post is more than 18 months old. Since technology changes to rapidly, this content may be out of date (but that's not always the case). Please remember to verify any technical or programming information with the current release.

This is a weird one… I had a form in the body of my page. Every time I would submit it, the csrf token would not match.

I finally thought it must be hitting the page one more time (I’ve had a problem like this before when image sources didn’t load…)… and sure enough, same issue.

In this case, however, I was found the following code:

document.writeln('<img class="album-cover" alt="" src="#" style="display:none;" />');

When I viewed the network tab in chrome, turns out it was issuing another request to my URL for some reason. Once this code was removed, it was good to go.

Return to All Posts