W
W
WebDev2016-06-02 12:13:01
Laravel
WebDev, 2016-06-02 12:13:01

Cookie conflict on subdomains?

Hello, please tell me how to be.
There are 3 sites: site.ru, m.site.ru and dev.site.ru.
The first 2 are full and mobile versions, they use the same database. In order for a user authorized on one domain to remain authorized when going to another, I specified in the settings that cookies on these domains be set for the site.ru domain.
The problem is that dev.site.ru is a domain for testing, it uses a different base. In his settings, I indicated that cookies were set for dev.site.ru, but at the same time, on this domain, the site also sees cookies from site.ru.
As a result, each cookie becomes 2 for site.ru and dev.site.ru.
How to separate these domains correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2016-06-02
@ollisso

> How to separate these domains correctly?
options:
1. add prefixes for cookies: dev_username for example
2. transfer dev to another domain (site.com)
3. when setting cookies on dev.site.ru, delete all cookies from site.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question