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.