ColdFusion 9 中的 Cflocation 错误/新功能 - URL 附加两次
当用户登录并重定向到安全页面时,URL 会像列表一样被附加两次。这反过来会导致 404。
(例如:http://uwf .edu/something.cfm,http://uwf.edu/something.cfm)
目前,该网站有一个自定义登录标签,我无法编辑该标签,因为我无法控制它。 (这只是一个自定义 cf 标签,允许人们在大学登录。)
我必须在此标签之后进行额外的处理,以验证他们是否有资格登录此特定站点。一旦验证通过,它们就会被重定向到带有 cflocation 的另一个页面。
<custom login tag>
<cfinvoke component="#application.path#cfc/security" method = "constructSession" returnvariable = "status">
.. params excluded..
</cfinvoke>
<cfif status eq 1>
<cflocation url="#someurl_invalid#" addtoken="no" />
<cfelse>
<cflocation url="#someurl#" addtoken="no" />
</cfif>
自定义登录标签已经刷新了当前页面,但我显然不希望这样,因此使用了上述方法来重定向。这在 ColdFusion 8 中有效。
文章给出了我对发生的事情有一些了解......但我不确定如何解决这个问题。 有人有解决办法吗?
When a user logs in and is redirected to a secured page, the url is getting appended twice like a list. This in turn causes a 404.
(example: http://uwf.edu/something.cfm,http://uwf.edu/something.cfm)
Currently, the site has a custom login tag which I am unable to edit as I do not have control over it. (It's just a custom cf tag that allows people to login at the university.)
I have to do additional processing after this tag to verify that they are eligible to login on this particular site. Once they have been verified, they are re-directed to another page with cflocation.
<custom login tag>
<cfinvoke component="#application.path#cfc/security" method = "constructSession" returnvariable = "status">
.. params excluded..
</cfinvoke>
<cfif status eq 1>
<cflocation url="#someurl_invalid#" addtoken="no" />
<cfelse>
<cflocation url="#someurl#" addtoken="no" />
</cfif>
The custom login tag refreshed the current page already, but I obviously do not want that and thus had used the above method to re-direct. This worked in ColdFusion 8.
I read this article: http://www.bennadel.com/blog/2050-Changes-In-CFLocation-OnRequestEnd-Behavior-In-ColdFusion-9-s-Application-cfc.htm
The article gave me some insight as to what is going on...but I am unsure how to fix the issue.
Does anyone have any solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您无法控制自定义标记,因此您必须解决该问题而不是修复它。
我建议更改代码:
它不太漂亮,但无论 URL 是否为列表,它都可以工作。
Since you don't have control over the custom tag, you'll have to work around the issue instead of fixing it.
I would recommend changing the code:
It's not pretty but will work whether the URLs are lists or not.