ColdFusion StructDelete创建空值 [英] Coldfusion StructDelete creates blank value

查看:125
本文介绍了ColdFusion StructDelete创建空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Codlfusion 9的StructDelete()方法从cookie中删除值。但使用后

I'm using Codlfusion 9's StructDelete() method to remove a value from a cookie. But after using

StructDelete(cookie,"selector12")

我得到 cookie.selector12 的值 [空字符串] em> it

I'm getting a value of [empty string] for cookie.selector12 despite deleting it

这是我使用的代码:

<cfdump var="#cookie#">
<!--- kill any existing selector cookie when looking at a profile --->
<cfset structDelete(cookie,'selector#URL.clk#')>
<cfdump var="selector#URL.clk#">
<cfdump var="#cookie#">

要提供以下输出:

StructDelete实际上只是设置空白值?或者我错过了一些明显和简单的...再次

Does StructDelete actually just set blank values? Or have I missed something obvious and simple... again

推荐答案

应用于COOKIE结构的StructDelete

The behavior of StructDelete() when applied to the COOKIE structure pushes the following header to your browser:

Set-Cookie SELECTOR12=;expires=Wed, 14-Dec-2011 10:06:02 GMT;path=/

这将依次(在请求生命的剩余时间)生成一个带有空值的浏览器cookie - 这模拟了在COOKIE结构上调用cfdump时看到的行为。

which in turn will (for the remainder of the life of that request) produce a browser cookie with a blank value -- which mimics the behavior you're seeing when calling cfdump on that COOKIE structure.

这只是一个交易的副作用与COOKIE结构,其实际上,包装访问您的浏览器的Cookie - 因此受限于如何在网络浏览器中定义/管理Cookie。

This is simply a side-effect of dealing with the COOKIE structure, which in reality, wraps access to your browser's cookies--and is therefore limited by how cookies are defined/managed in web-browsers.

这篇关于ColdFusion StructDelete创建空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆