Fast implementation of single point landing in ASP.net 1.1/2.0

Source: Internet
Author: User
Tags domain domain name
asp.net

  Problem:

Site has bbs.xxx.com/main.xxx.com/pay.xxx.com these three different two-level domain name station, to achieve any level one or two domain name landing, the other two-class domain name stations are landing.

  Solution:

Sets the domain property of the cookie.

Detailed Introduction:

Set the domain of the cookie that holds the user login information to the same. Usercookie. Domain= ". xxx.com"; Be aware that you must add a "." Before the domain name. This setting is required when landing and exiting.

The more common practice is to manage these transactions with a class that is specifically responsible for user login. So the other landing page just call this class can be, Itong. And if you use ASP.net 2.0 and forms validation, there's a simpler way to do this.

Support for Domains is added to the web.config, as long as you follow the following settings:

<authentication mode= "Forms" >
<forms loginurl= "Login.aspx" domain=. xxx.com "Name=". Autolinkedusitecookie "/>
</authentication>

Domain: Optional attribute.

Specifies the optional domain that is set in the outgoing Forms authentication Cookie. This setting has a higher precedence than the domain used in the httpcookies element. This property is a new property in the. NET Framework version 2.0. The default value is an empty string ("").

  Attention

Either way, the name of the cookie must be the same.



Related Article

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.