Added Cookie handling to prevent double submits.