How does Yii redirect to a second-level domain name after logon?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.