将变量从一个网站页面传递到另一个网站页面而不使用 QueryString

发布于 2024-10-09 18:06:38 字数 399 浏览 0 评论 0原文

这个问题与上一个问题相关 在页面之间传递变量使用 ASP.NET (C#) 而不使用 QueryString

我的情况的不同之处在于,请求来自不同的网站(在 java 中)到我的网站(在 asp.net 中)。我不希望变量出现在 url 中。

任何建议!

为了解释我的场景,我们正在制作一个网页(插件),可以从任何其他网站调用它。为了验证请求,我正在寻找一种机制,当其他网站将传递 id 和 id 时我的页面的授权密钥。我可以用它来验证请求。我不希望这些变量可见。

This question is related to a previous question
Passing Variable from page to page using ASP.NET (C#) without using QueryString

The difference in my case is that the request is coming from a different website (in java) to my website (in asp.net). I do not want the variable to appear in url.

Any suggestions !!

To explain my scenario, we are making a webpage(plugin), which can be called from any other website. To authenticate request, i am looking for a mechanism when other website will pass id & auth-key to my page. This i can use to authenticate the request. I do not want these variable to be visible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倦话 2024-10-16 18:06:38

POST 操作就可以了。该变量仍然是请求的一部分,但用户不容易看到它。我说“随时”可见是因为它不会成为请求的 URL 的一部分,但如果他们使用 Firebug 等工具,它就会可见。由于缺乏共享数据库或其他形式的“带外”通信,我不确定是否可以通过其他方式完成......

A POST operation would work. The variable would still be part of the request, but it would not be readily visible to the user. I say "readily" visible because it won't be part of the requested URL, but it would be visible if they were to use a tool like Firebug. Short of sharing a database or some other form of "out-of-band" communication, I'm not sure it can be done any other way...

奢华的一滴泪 2024-10-16 18:06:38

正如克里斯提到的,执行 POST 是实现此目标的最佳方法。或者你可以看看使用 javascript 来实现同样的目的。使用 JS 库来实现同样的效果非常容易。

我想到的一些是
一)Jquery
b) 尤伊
c) EXT(我猜现在是Sencha)

但我肯定会推荐jquery。

使用 jquery,您可以使用 api 来执行后期操作。这里有更多关于如何实现相同目标的信息。
http://api.jquery.com/jQuery.post/

希望有所帮助。

Well as chris mentioned doing a POST is the best way to achieve this. Else you can look at using javascript to achieve the same. Its pretty easy to use JS libraries to achieve the same.

Some of them that come to my mind are
a) Jquery
b) YUI
c) EXT (now Sencha i guess)

But I would definitely recommend jquery.

With jquery you have apis to do post operations. here is more on how to achieve the same.
http://api.jquery.com/jQuery.post/

Hope that helps.

潦草背影 2024-10-16 18:06:38

我认为没有查询字符串就无法完成。我知道会话不起作用,因为会话不能在 Java、Asp、Asp.net、Php 等之间共享...,至少不能在本地共享。如果您有一个存储会话的数据库,则始终可以在查询字符串中使用会话 ID,从而模拟跨语言会话。

I don't think it can be done without a query string. I know sessions won't work because sessions cannot be shared between Java, Asp, Asp.net, Php etc..., at least not nativly. If you have a database where you store the sessions, you can always use a session id in a query string and therefore simulate cross-language-sessions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文