Cross domains sessions - shared shopping cart cross domains

Posted by Jaroslav Moravec on Stack Overflow See other posts from Stack Overflow or by Jaroslav Moravec
Published on 2010-06-02T08:56:55Z Indexed on 2010/06/02 22:54 UTC
Read the original article Hit count: 550

Hi, we are solving the problem with eshop (php, mysql). The client want to have the same eshop on two domains with shared shopping cart. In the shop customer can do the shopping without users account (can't be logged in). And there is the problem, how to make the shared shopping cart cross domain.

The data from cart is stored in sessions, which we stored in database too. But we can't solve the problem in carrying data over domains. Identifying unlogged user is not holeproof (research).

The example, how it should work

Customer goes to domainOne and add some things to the cart. Than he goes to domainTwo (by link, typing domain address, however) and add some other things to the cart. In the cart he has things from both domains (after refreshing page).

Do you have any idea, how to solve this problem?

What didn't work:

  • redirecting is not possible due to customer requirments
  • cookies are related to domain
  • set_cookie with the other domain didn't work
  • the simpliest way is to carry over only the sessionid (stored in cookies) but we don't know, how to wholeproof identify unlogged users.
  • is there any other place, where data can be stored on client side except cookies? (probably not)
  • we can't use sending sessionid by params in url (if user click to link to the other domain) or resolving the header referer, bcs we don't know, how user can achieve the other domain.

If you can't understand me, take me a question. If you think, that having eshop on two domains with shared (common) cart is bad idea, don't tell me, we know it.

Thanks for each answer.

© Stack Overflow or respective owner

Related posts about php

Related posts about session