Cannot migrate Anonymous to registered user

V

Vincent Ye

Hi All,

I have an application which is using memship and profile functions. It works
well in my develop machine which is using SQL Express Edition Server as the
provider.

When I move this application to the hosting server. It works well when the
user is anonymous. But after user logins, the Profile_MigrateAnonymous event
in Global.asax is called when user browses every pages. So even I change the
value in Profile, it keeps getting back the value from the one in anonymous
status.

Can you tell me why it happens? And how can I fix it?

Thanks in advance

-Vincent
 
S

Steven Cheng[MSFT]

Hi Vincent,

Welcome to the ASPNET newsgroup.

As for the Profile_MigrateAnonymous event, it does will fire after the user
has login the web application(swtich from anonymous status to authenticated
status). Also, based on my research, the event will always fire if there
still contains an anonymous identity asosociated with the current session,
so I think we need to remove the anonymous identity after the current user
has been authenticated. This is somewhat related to the
Profile_MigrateAnonymous event's implementation, the httpModule will always
fire this event if an anonymous idenity is detected. Here is the code from
MSDN document on the Profile_MigrateAnonymous event:

void Profile_MigrateAnonymous(Object sender,
ProfileMigrateEventArgs e)
{

// here is our migrate code

ProfileManager.DeleteProfile(e.AnonymousID);
AnonymousIdentificationModule.ClearAnonymousIdentifier();
}

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
V

Vincent Ye

Hi Steven,

Thanks for your reply.

Actually, I had this code in that event. But it still fires. As I mentioned
in my previous post. It works well in my develop machine. It doesn't work
on the hosting server. I think one of the differences between two machines
is in develop machine, I use SQL Express Edition Server; In hosting server,
I use SQL 2000 server.

Any more idea?

Thanks

-Vincent
 
S

Steven Cheng[MSFT]

Thanks for the followup Vincent,

I think the difference you mentioned is a potential cause. Have you admin
control to the host server? If so, we can monitor the host server database
to see whether the anonymous identity is acutally created and then be
removed when the user login(be authenticated). Also, is the host server's
SQL 2000 database be correctly configured through the aspnet_regsql tool?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top