How to Synchronize anonymous users with authenticated users using profiles?

R

Rodusa

I am trying to Synchronize anonymous users with authenticated uses
using Profile_MigrateAnonymous. However Profile_MigrateAnonymous only
carries information in one direction, for instance, if I delete one
item from the basket in a shopping cart when the user is still
anonymous, the item comes back right after I log out. I would like to
know if is there any way to synchronize both directions so that the
user sees the information in the basket either as being anonymous user
or authenticated user?

void Profile_MigrateAnonymous(object sender, ProfileMigrateEventArgs e)

{

ProfileCommon anonymousProfile = Profile.GetProfile(e.AnonymousID);

if (anonymousProfile != null && anonymousProfile.CurrentBasketInfo !=
null)

{

Profile.CurrentBasketInfo = anonymousProfile.CurrentBasketInfo;

}

}

PS: if I use ProfileManager.DeleteProfile(e.Anonymous) in my migrate
event, it will clear the anonymous basket. I could then try to set it
back to the authenticated profile when the user updates the
authenticated profile. However, if the user closes and opens the
browser without loging out, there is no way you can set the anonymous
profile= authenticated profile .

Rod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top