火狐发送请求两次 [英] Firefox sending request twice

查看:434
本文介绍了火狐发送请求两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图处理信用卡交易在.NET和它完美的作品在Safari,Opera和IE浏览器。当我尝试在Firefox发送两个请求相同的事务,我结束了一个双重收费卡。从对谷歌快速搜索似乎这是一个问题与萤火虫,但我无法找到一个方法来阻止这种双重职务。

I'm trying to process a credit card transaction in .net and it works perfectly in Safari, Opera, and IE. When I try the same transaction in Firefox it sends two requests and I end up with a double charged card. From a quick search on Google it seems that this is an issue with Firebug but I am unable to find a way to stop this double post.

有没有人有任何想法如何从这样prevent火狐(和萤火虫)?

Does anyone have any idea on how to prevent Firefox (and Firebug) from doing this?

推荐答案

使用现时 ,一个独特的键是只使用一次。

Use a nonce, a unique key which is only used once.

发送与表单字段到浏览器的唯一编号(这往往是一个隐藏的输入字段进行),并保存副本的服务器与交易上。在窗体,更改提交的数量。验证该密钥匹配处理您的请求时。

Send a unique number along with the form fields to the browser (this is often done with a hidden input field), and store a copy on the server with the transaction. Within the form, change the number on submit. Validate that the keys match when processing your requests.

也可能会发生的事情在前端一个明确的解释,这个问题是可以消除客户端。这是最好的解决服务器上的双提交的问题,只是因为有这么多的方法,使双提交可能发生。

There may also be a clear explanation of what's happening on the front end, and that issue could be eliminated client-side. It's best to solve the double-submit problem on the server, simply because there are so many ways in which a double submit could occur.

这篇关于火狐发送请求两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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