K
K
Koal Koalich2020-08-10 13:08:03
HTTP Cookies
Koal Koalich, 2020-08-10 13:08:03

Cookies of the main site "interfering" with the site on the subdomain?

Situation: the site on the subdomain stopped authorizing. There are no error codes in the debugger on the network tab. The logs seem to be clean too. But after the authorization form sends again to it.
I noticed that this happened after visiting the main site domen.ru, and for a long time I worked only with subdomain.domen.ru. Tested it in another browser and in private modes.
Also during the "investigation" I noticed that if we already have .domen.ru cookies, then such a situation arises with authorization. We delete such a cookie - everything works fine.

Domen.ru site on cms Bitrix (if it is important; the setting "Distribute cookies to all domains" is deactivated). This behavior has not been observed before.

The reason "almost found". Now the question is: how to debug it? Need to tweak something for cookies in php.ini? the same strict?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maltf0, 2021-06-12
@maltf0

Add to init.php

session_name(\Bitrix\Main\Config\Option::get('main', 'cookie_name') . '_PHPSESSID');

And in the settings of the Main module -> Prefix name for the cookie name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question