A
A
Adik Izat2020-05-18 22:23:43
PHP
Adik Izat, 2020-05-18 22:23:43

How to navigate from a site to a subdomain using the post method?

Good time, forum users! I turn to you with a question. What tools should I use in my case?

The idea is this:
There is a main site, written in pure php. The main site is like a regular CRUD application with authorization in which students and teachers can register, courses can be placed.
In the future, it is planned to place on the subdomain a site with course rooms where there will be a chat, video chat and a game. The subdomain will be written in React using socket.io.

Problem:
On the main site on the course page, by clicking on the "Connect" button, the student / mentor should get into the corresponding room. Each user has his own login/id and a hidden token. Access to the room is carried out through them, but they must be accepted using the POST method. What PHP tools should be used so that when the user clicks the "Connect" button, the user is redirected to a subdomain and the necessary data for the React application is transmitted in the redirect to the POST?

Thanks everyone for the replies. Sorry if the question sounded stupid even for a joon;)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
P747, 2020-05-18
@JaxAdam

You can, for example, send an AJAX request with the necessary post data to a subdomain, in response, upon successful authorization, send the same authorization token and set it in a cookie for the entire domain or a specific subdomain, then readrect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question