Home  >  Article  >  Backend Development  >  laravel multiple domain name login problem such as qiyue.io me.qiyue.io

laravel multiple domain name login problem such as qiyue.io me.qiyue.io

WBOY
WBOYOriginal
2016-08-29 08:50:561063browse

A website has one main domain name, multiple sub-domain names, and a common login. I found out later

You can log in to the main domain name, but you cannot log in to the subdomain name. After logging in to the main domain name, you still cannot log in to the subdomain name. Moreover, clicking login on the subdomain name will jump back to the homepage of the subdomain name, and you cannot enter the login page

How to solve it?

Using Laravel 5.2.*

For example: main domain name qiyue.io
sub-domain name blog.qiyue.io

Reply content:

A website has one main domain name, multiple sub-domain names, and a common login. I found out later

You can log in to the main domain name, but you cannot log in to the subdomain name. After logging in to the main domain name, you still cannot log in to the subdomain name. Moreover, clicking login on the subdomain name will jump back to the homepage of the subdomain name, and you cannot enter the login page

How to solve it?

Using Laravel 5.2.*

For example: main domain name qiyue.io
sub-domain name blog.qiyue.io

Session synchronization:
Requires the following three steps

  1. redis save session

  2. The cookie domain name of
  3. session is changed to

  4. The secrets of the two projects have been changed to the same

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn