P
P
Peter2016-09-15 11:31:06
HTTP Cookies
Peter, 2016-09-15 11:31:06

Why is authorization replacing the wrong cookies?

The service (localhost:3000) is locally raised and two sites also work locally with this service.
One on the port localhost:8003 , the second localhost:8002 .
From the beginning, one site is authorized (on the localhost:8002/ domain) , it receives cookies with a token.
Then the second one ( localhost:8003 ) is authorized, it also receives cookies with a token, but these cookies are replaced by cookies from localhost:8002/.
I am using chrome browser.
Why is this happening? And how to fix this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Zayko, 2016-09-16
@volkov_p_v

Cookies work per domain, not per port. Well, respectively, they are overwritten, try to display the data of the $_SESSION array on two domains after authorization, if everything is fine, remove the authorization on the second port. And yes, don't do that on the combat site)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question