我有一种情况,我希望在页面的初始条目上删除会话变量。
我正在尝试像这样实现它(JavaScript:SetNextPage()将设置hidSection为类似"PAGEONE"或的页面名称"PAGETWO")
<!--- If INIT page access, it will be "" Otherwise it will not be "" --->
<cfset hidSection_val = "">
<cfif IsDefined("FORM.hidSection")>
    <cfset hidSection_val = FORM.hidSection>
</cfif>
<cfif hidSection_val eq "">
    <cfset tmp = StructClear(SESSION)>
    <cfset SESSION = StructNew()>
    <cfset hidSection_value = "PAGEONE">
<cfelse>
     <!--- Do other stuff --->
</cfif>
.
.
.
<input type="submit" name="btnAddToSession" id="btnAddToSession" value="Add" />
<input type="submit" name="btnNextPage" id="btnNextPage" value="Next Page" OnClick="SetNextPage()" />
<input type="hidden" id="hidSection" name="hidSection" value="#hidSection_value#">
我省略了很多代码,但我想我已经在那里列出了基本的代码。
所以我采取的步骤:
- 输入表单信息,然后单击添加按钮
 单击浏览器的 URL 栏,然后按 Enter
注意:在这个阶段,我希望代码通过 StructClear 等运行。
- 我点击下一页按钮
 - 我能够 CFDUMP 包含所有值的会话变量。
 
为什么在我清除会话变量后显示它们?
FireFox 和 Chrome 正在按预期工作。但是,它在 IE8 中不起作用!
这是一个 IE8 问题还是我对 StructClear 等有某种错误的想法?有任何想法吗?