Subdomains and Logins

前端 未结 2 1724
囚心锁ツ
囚心锁ツ 2021-02-10 19:57

If you multiple subdomains e.g.:

sub1.domain_name.com

sub2.domain_name.com

Is there a way to have a user be able to log into both

2条回答
  •  迷失自我
    2021-02-10 20:45

    Yes. Just set the cookie on the domain ".domain_name.com" and the cookie will be available to sub1.domain_name.com, and sub2.domain_name.com.

    As long as you maintain your session information on both domains, you should be fine.

    This is a very common practice, and is why you can log into your Google Account at http://www.google.com/ and still be logged in at http://mail.google.com.

提交回复
热议问题