Profile understanding in petshop4.0 (anonymous user identity)

Source: Internet
Author: User

When you browse in petshop without logon, you are holding and using an anonymous user identity. The username of this user identity isGuid string. The user migration method can be used to transform anonymous users into audit users. In fact, the profile and cookie are generated for anonymous users, but the maintained status is stored on the local computer, if the cookie expires or another computer is used, information may be lost.

When in petshopCheck outThen, it will jump to signin. aspx to log on, and then executeGlobal. asaxInProfile Table and cart tableConverts anonymous user information into login user information.

RunGlobal. asaxIn profilemanager. deleteprofile (E. anonymousid); then jump to the following method in petshop. profile. petshopprofileprovider:

 

Code
  Public   Override   Int Deleteprofiles ( String [] Usernames ){

IntDeletecount= 0;

foreach ( string User in usernames)
If (deleteprofile (User ))
deletecount ++ ;

ReturnDeletecount;
}
Private Static BoolDeleteprofile (StringUsername ){
Checkusername (username );
ReturnDal. deleteprofile (username, applicationname );
}

 

Run petshop. sqlprofiledal. petshopprofileprovider

 

Code
Public   Bool Deleteprofile ( String Username, String Appname ){

IntUniqueid=Getuniqueid (username,False,True, Appname );

String Sqldelete =   " Delete from profiles where uniqueid = @ uniqueid; " ;
Sqlparameter Param =   New Sqlparameter ( " @ Uniqueid " , Sqldbtype. Int, 4 );
Param. Value = Uniqueid;

IntNumdeleted=Sqlhelper. executenonquery (sqlhelper. connectionstringprofile, commandtype. Text, sqldelete, Param );

If (Numdeleted <=   0 )
Return   False ;
Else
Return   True ;
}

 

Method To delete anonymous users.

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.