Question
Kill Session with Javascript
Hello,
This what I am doing now in the form Search page. When the form loads in the browser, I do the below to kill these session variables, but when a user pages backwards with the browser back button, for some reason the sessions do not get killed. Is there a way to use the onclick or submit event of javascript to Kill CF sessions?
<cfset Goldvars = "searchresults"&","&"searchresultsTotal"&","&"searchresults2"&","&"search2total">
<cfloop list="#Goldvars#" index="i" delimiters=",">
<cfif isdefined("session.#i#")>
<cfset rc = StructDelete(session,"#i#","True")>
</cfif>
</cfloop>
This what I am doing now in the form Search page. When the form loads in the browser, I do the below to kill these session variables, but when a user pages backwards with the browser back button, for some reason the sessions do not get killed. Is there a way to use the onclick or submit event of javascript to Kill CF sessions?
<cfset Goldvars = "searchresults"&","&"searchresultsTotal"&","&"searchresults2"&","&"search2total">
<cfloop list="#Goldvars#" index="i" delimiters=",">
<cfif isdefined("session.#i#")>
<cfset rc = StructDelete(session,"#i#","True")>
</cfif>
</cfloop>