在回调中读取会话或 cookie
我们有 ASP.NET MVC 3 应用程序,它与 Google Checkout API 集成。有没有办法在 Google Checkout CallBack 上访问网站的 Session
或 Cookie
?
假设我已使用用户 ID:ramiz 和密码:r@miz 登录我的网站。当我在登录时提供我的凭据后,它会收集有关我的更多详细信息并将其放入会话中(例如名字和姓氏)。一旦我进去,我就会看到(二手)iPhone 的列表。在那里,我看到了 iPhone 3G 的特价促销,仅需 150 美元。该交易前面有一个“立即购买”按钮。我点击它,它会询问我更多数据,最后带我到 Google Checkout 进行交易并下订单。我这样做了,它显示了一条“谢谢”消息,这意味着交易已成功完成。
当我们结帐时,Google 会调用我们定义的回调 URL,我们可以在其中收集包含订单详细信息的通知 XML。我们正在收到通知 XML,并很高兴看到我们需要的所有详细信息都在其中。在这里,我们需要访问用户会话或 Cookie 以获取他的名字/姓氏和用户 ID。我们尝试访问会话/Cookie,但似乎失败。
我们如何在这里访问 Session
或 Cookie
?或者有什么好的方法可以做到这一点吗?
谢谢。
We have ASP.NET MVC 3 application which is integrated with Google Checkout API. Is there a way to access Session
or Cookie
of the Site on Google Checkout CallBack?
Suppose, I have logged into my site with UserID: ramiz and Password: r@miz. After I provided my credentials on Login it collects more details about me and put them in session (like, First and Last Name). Once I get in, I see a list of (used) iPhone. There, I see a cheap deal offering iPhone 3G only $150. There is a button of "Buy Now" in front of that deal. I click on this it ask me some more data and finally take me to the Google Checkout to do the transaction and place the order. I did and it shows me a "Thanks" message which means the transaction is completed successfully.
When we checkout Google calls our defined CallBack URL where we can collect the Nofitication XML which has Order Details. We are getting that Notification XML and happy to see all details is in there which we required. Here, we need to access the user Session or Cookie to get his First/Last Name and UserID. We have tried to access the Session/Cookie but it seems fail.
How do we have access Session
or Cookie
here? Or is there any good way of doing this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅当客户端(浏览器)实际返回您的网站(如果返回)时,才能访问 Cookie(包括会话 Cookie)。
您可以考虑将数据存储在:
而不是 cookie。这些将在新订单通知中回显给您的处理程序。
Cookies (including session cookies) can only be accessed if the client (browser) actually goes back to your web site (if they do).
You can look into storing the data in:
instead of cookies. These will be echoed back to your handler in new-order-notification.