Cannot migrate Anonymous to registered user

Discussion in 'ASP .Net' started by Vincent Ye, Feb 23, 2006.

  1. Vincent Ye

    Vincent Ye Guest

    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
    Vincent Ye, Feb 23, 2006
    #1
    1. Advertising

  2. 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.)
    Steven Cheng[MSFT], Feb 24, 2006
    #2
    1. Advertising

  3. Vincent Ye

    Vincent Ye Guest

    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

    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > 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.)
    >
    Vincent Ye, Feb 24, 2006
    #3
  4. 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.)
    Steven Cheng[MSFT], Feb 28, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amol Shambharker
    Replies:
    1
    Views:
    432
    Cor Ligthert
    Apr 30, 2004
  2. Replies:
    7
    Views:
    4,159
    Wilfred Knievel
    Mar 13, 2009
  3. Reporter
    Replies:
    3
    Views:
    476
    Mike Schilling
    May 12, 2007
  4. GeoffreyD
    Replies:
    2
    Views:
    519
    Steven Cheng[MSFT]
    Jan 29, 2008
  5. Replies:
    1
    Views:
    220
Loading...

Share This Page