Website members log on to the Forum synchronously, and change the password for Synchronous logon. However, after logging on to the Forum, the website also synchronizes the logon status, which requires the website to know the cookie information of the Forum, and make corresponding modifications to achieve this.
Specifically, in the forum
Forum-global-registration and access control
In the "authentication cookie domain" text box, enter ".bubufx.com"
In this way, the cookie after the Forum login is detected as follows:
Userid = 1 Password = login % 3d % 3 dtpp = 0ppp = 0 pmsound = 0 invisible = 0 Referer = index. aspxsigstatus = 0 expires = 1440 userinfotips =
Based on these cookies, you can log on to the Forum on the website page and synchronize them to the website.
If (! Cm. islogin () // when the Website member is not logged on, determine whether the forum member has logged on. If the Member is logged on, the member will be logged on, set this member to the logon status {try {If (request. cookies ["DNT"]! = NULL & request. Cookies ["DNT"]. Values ["userid"]! = NULL) {string uid = request. cookies ["DNT"]. values ["userid"]. tostring (); string cookiedomain = ".qzcd.net"; // your domain name discuzsession DS = websamplehelper. discuzsessionhelper. getsession (); discuz. toolkit. user user = NULL; user = Ds. getuserinfo (convert. toint32 (UID); If (user! = NULL) {// set the user name to the logon success status of [user. Username] }}catch {}}
In this way, website login synchronization, registration user synchronization, password modification synchronization, and Forum login synchronization are all implemented to the website. Then, register a user in the Forum and change the password, you can perform a redirection to synchronize data with the website. When registering a new user in the forum, you will jump to the website registration user interface. The password change page in the Forum will jump to the website's password change page, as shown below:
Jump when registering a user. In the register. aspx file, add
// Add later, jump to the master site to register templatebuilder. append ("<script language = \" javascript \ "type = \" text/JavaScript \ "> window. top. location. href = 'HTTP: // www.bubufx.com/reg.aspx'; </"); templatebuilder. append ("script> ");//
About
Base. oninit (E); templatebuilder. capacity = 220000;
CodeLater.
Jump when changing the password. In the usercpnewpassword. aspx file, add
// Add later, jump to the master site to register templatebuilder. append ("<script language = \" javascript \ "type = \" text/JavaScript \ "> window. top. location. href = 'HTTP: // www.bubufx.com/member/memberpass.aspx'; </"); templatebuilder. append ("script> ");//
About
Base. oninit (E); templatebuilder. capacity = 220000;
After the code.
So far, it is a complete solution to synchronize Forum members.
Bu shares original technologies. For more information, see:Http://tech.bubufx.com/infodetail_26.html