两个域、一个站点、一个 SSL 结帐。如何获取cookie?

发布于 2024-09-12 03:52:50 字数 314 浏览 1 评论 0原文

有一个多语言网上商店,访问者可以从两个域使用不同的语言访问:
hxxp://x.com - 英语
hxxp://x.ru - 俄语,是 x.com 的附加域。

身份验证和购物车页面通过 SSL 位于此处: https://x.com/index.php?mode=login

如何使用hxxps://x.com上x.ru的cookie信息? 是否可以将x.ru的访问者重定向到hxxps://x.com进行身份验证,然后再重定向回x.ru?

谢谢。

There is a multilingual web shop, visitors can access from two domains, with different language:
hxxp://x.com - English
hxxp://x.ru - Russian, which is an add-on domain to x.com.

The authentication and cart pages are here, through SSL:
https://x.com/index.php?mode=login

How can I use the cookie informations of x.ru on hxxps://x.com?
And is it ok to redirect the visitors of x.ru to hxxps://x.com for authentication, and after that, redirect back to x.ru?

thank you.

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

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

发布评论

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

评论(2

糖果控 2024-09-19 03:52:50

这不能完全按照您的意愿完成。 x.com 和 x.ru 是不同的网站;如果 x.ru 和 gmail.com 可以共享 cookie 数据,那么他们也可以。那会很糟糕。

请参阅跨域 cookie 访问(或会话)

我相信您可以从 x.com 为 x.ru 设置第三方 cookie,但第三方 cookie 经常被用户的浏览器阻止(有充分的理由)。

This cannot be done precisely as you want. x.com and x.ru are different sites; if they could share cookie data, x.ru and gmail.com could also. That would be bad.

See Cross domain cookie access (or session) .

I believe you can set a third-party cookie for x.ru from x.com, but third-party cookies are often blocked by users' browers (for good reason).

小嗷兮 2024-09-19 03:52:50

如果您查看任何 Google 身份验证页面,它会将您重定向到 SSL 登录页面,然后返回到简单的 http 页面。所以我认为这会很好。

IMO 您可以使用唯一令牌将 cookie 信息存储在数据库中,然后根据存储的 cookie/会话变量检查此数据。

If you look any Google auth page it's redirect you to a SSL login page then returns to a simple http one. So i think this will be fine.

IMO you can store cookie informations in a database with a unique token then check this data against stored cookies/session variables.

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