I’m performing a security check on a form with the following logic: I have a hidden input in the form that receives a CreateUUID() value, and the same value goes into the session.
Example:
session.IdTemp = CreateUUID();
<input name="test" type="hidden" value="#session.IdTemp#">
On the page that receives the form submission, I validate if the input value is the same as the session value. If positive, I clear the session value and continue the flow. If the client clicks the submit button multiple times, the second time will hit the session without a value and the input with a value, so I abort the flow.
<cfif form.test EQ session.IdTemp >
<cfset session.IdTemp = "">
<cfelse>
<cfabort>
</cfif>
However, when I use <cfset session.IdTemp = "">
to clear the session, the code behaves as if the page had been reloaded. It enters the IF statement, clears the session, and then goes to the ELSE immediately after, aborting the page. If I remove the set that clears the session, the flow works as it should, only entering the IF statement.
Has anyone seen this?
Thanks
OS: Windows Server 2022 Standard
Java Version: 11.0.20.1
Tomcat Version: 9.0.80
Lucee Version: 6.0.0.585