How does Yii redirect to a second-level domain name after logon? The function I want to achieve is that the user automatically jumps to user.domain.com after logging on from www.domain.com. I used string concatenation to achieve page jump (I wonder if there is a better way ?) The current problem is that the user's logon status is invalid after the page jump, and you need to log on again. find a solution from you. yii has never been used, but how does Yii jump to the second-level domain name after login?
The function I want to achieve is: the user automatically jumps to user.domain.com after logging on from www.domain.com,
I used the string concatenation method to achieve page jump (I wonder if there is a better way ?)
The current problem is that the user's logon status is invalid after the page jump. you need to log on again.
Ask you for solutions.
------ Solution --------------------
Yii has never been used. However, if your login is invalid, it indicates that the domain saved in your cookie is incorrect. it should be .domain.com.
------ Solution --------------------
Php cross-origin sharing session
Http://blog.sina.com.cn/s/blog_4b64149a01000780.html
------ Solution --------------------
You can configure the user component in the configuration file (generally main. php:
PHP code
'User' => array (// enable cookie-based authentication 'allowautologin' => true, 'returnurl' => 'User .domain.com '),
------ Solution --------------------
PHP code
------ Solution --------------------
If the login information is cross-origin, it cannot be obtained. you need to solve this cross-origin problem.
------ Solution --------------------
Each cookie string belongs to a domain. if the cookie set in www.domain.com cannot be read in user.domain.com.
But you can set it to * .domain.com, so that both the primary domain name and the second-level domain name are consistent, and cookie sharing is realized.