开发者

Deleting a session/structure with coldfusion

开发者 https://www.devze.com 2023-02-22 04:29 出处:网络
I have a session which is a collection of structures SESSION.squad.achievements[key] so it may be SESSION.squad.achievements[2010] = "swam 开发者_JAVA百科the english channel";

I have a session which is a collection of structures

SESSION.squad.achievements[key]

so it may be

SESSION.squad.achievements[2010] = "swam 开发者_JAVA百科the english channel";
SESSION.squad.achievements[2009] = "ran a marathon";
SESSION.squad.achievements[2008] = "cycled Le Tour";

My code deletes the stucture temporarily, but does not delete the session so when I refresh the value still exists

<cfset myYear = #myYear# />
<cfset #StructDelete(SESSION.squad.achievements, myYear)#>

Any ideas how I can delete this value?


Try using cflock

<cflock timeout="30" throwontimeout="No" type="EXCLUSIVE" scope="SESSION">
    <cfset StructDelete(SESSION.squad.achievements, myYear)>
</cflock>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号