Y
Y
Yuri Tatarkin2016-07-18 11:40:11
PHP
Yuri Tatarkin, 2016-07-18 11:40:11

How to make a cross-domain session?

Online store (opencart 2 if it matters). The store has several language versions working on different domains. .com, .ru, .fr, and so on. All work on the same engine installation.
There is a task to start with making a common basket, so that it would not be reset when changing the domain.
1. Domains are not subdomains of one, but different second-level domains.
2. On all https domains
How is this implemented correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-07-18
@alsopub

Alternatively, the login form is sent, for example, to shop1.com, which generates a session_id, resets the cookie sid = 1234.....999 and immediately Location: https://site2.com/start-session/?id=1234... ..999 , on site2.com also set cookies and already redirect to the right place.
Then the cookie will be set on two sites.
If the session is annoying in GET, you can use javascript + jquery + post.
Second option.
Authorization on one site and loading something from the second site with the transfer of session_id so that the second site sets a cookie along with the response.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question