两个不同服务器之间的会话。
你好,朋友们,我正在开发一个电子商务应用程序,其中集成了贝宝沙箱。
在 Paypal 进行交易后,我的会话在返回我自己的网站时被破坏。我如何在 JSP servlet 中维护该会话?
Hello friends i am developeing a e-commerce application in which i am integrating the paypal sandbox.
After transactions at Paypal, my session gets destroyed on returning to my own site. How can i maintain that session in JSP servlets?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http
中创建用户会话,但 paypal 返回到https
,则可能会出现问题。如果超时、cookie 和协议都正常,则访问者返回您的站点时应该会获得相同的会话。
http
but paypal is returning tohttps
, there can be problems.If both timeout, cookies and protocol are fine, the visitor should get the same session when he returns to your site.
我上次使用 Paypal 已经很长时间了,而且只使用 PHP,但据我记得你必须向 Paypal 提供一个“返回 URL”作为参数,Paypal 应该使用该参数将请求重定向回你的网站处理付款。为了使会话保持活动状态,您需要将
jsessionid
属性附加到 URL,并将当前会话 ID 作为值。另一种方法是在弹出窗口中处理此问题,并在 Paypal 返回时让窗口关闭。父窗口中的会话将仅被保留。
It has been a long time I used Paypal for the last and it was with PHP only, but as far as I recall you had to supply Paypal a "return URL" as parameter which Paypal should use to redirect the request back to your site after processing the payment. In order to keep the session alive, you need to append the
jsessionid
attribute to the URL with the current session ID as value.An alternative is to handle this in a popup window instead and let the window close when Paypal returns. The session in the parent window will just be retained.