Second-level domain name sharing master site cookies login, integration-Asp

Source: Internet
Author: User

For example, there is currently a station: www.abc.com sub-station: 123.abc.com, you want to log on from the primary domain name, or log on from the subdomain can be synchronized, that is, as long as you log on from any station, you can log on from another station.

I have introduced many methods on the internet, and I have tried it. I can't do it because I cannot clear cookies. In the end, I can't do it. I just give up and watch a movie at night: as soon as I looked at it, I thought: How can the death of God arrange for people to die? Then I wanted to share cookies, so there was a way to clear cookies.

The current effect is: you can log on to any site at www.abc.com sub-station: 123.abc.com, and all cookies are common for one site. No matter you exit from any site, all main and sub-sites will be withdrawn

Method:
Add:
Response. Cookies ("mycookies") ("username") = RS ("username ")
Response. Cookies ("mycookies"). Path = "/"
Response. Cookies ("mycookies"). Domain = "abc.com" 'abc. com is added before ."
Response. Cookies ("mycookies"). Secure = false
Response. Cookies ("mycookies"). expires = dateadd ("H", 24, now () 'is not set to your own. You can skip this or

When exiting: Add:

Response. Cookies ("mycookies"). expires = now ()-1
Response. Cookies ("mycookies") ("username") = ""
Response. Cookies ("mycookies"). Path = "/"
Response. Cookies ("mycookies"). Domain = "abc.com"
Response. Cookies ("mycookies"). Secure = false

Note: When logging on to a website, you must note that as long as cookies are modified or updated in that place, you must add:

Response. Cookies ("mycookies"). Path = "/"
Response. Cookies ("mycookies"). Domain = "abc.com"
Response. Cookies ("mycookies"). Secure = false

Another note is that when you exit: If you exit the sub-domain name, you must add a logout. asp exit file to each site.
I have not tried cross-domain names. I don't know if it works.

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.