Where does ASP.NET 2.0 insert a anonymous user? thanks

Last post 12-09-2005 2:05 PM by wyx2000. 6 replies.

Sort Posts:

  • Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-07-2005, 5:31 PM
    • Contributor
      3,349 point Contributor
    • wyx2000
    • Member since 11-25-2002, 6:43 AM
    • Posts 812

    After switched to RTM, I can not make anonymouseidentity works for me, it doesn't create any anonymous user in aspnet_users table, I am trying to figure out why. Could someone tell me how ASP.NET 2.0 create a anonymous user? where should I check?

    I have the following settings in my web.config, I thought before it create the anonymous cookie, it will insert a record into aspnet_users  table, but it doesn't , and it doesn't report any error neither.

    <anonymousIdentification enabled="true" cookieName=".LINKANONYMOUS"/>

    <profile enabled="true">

    <properties>

    <add name="FirstName" type="System.String"/>

    <add name="LastName" type="System.String" allowAnonymous="true"/>

    <add name="UICulture" type="System.String" allowAnonymous="true"/>

    <add name="Theme" type="System.String" allowAnonymous="true"/>

     

  • Re: Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-08-2005, 12:21 PM
    • Participant
      1,640 point Participant
    • Laura
    • Member since 06-14-2002, 10:50 AM
    • Posts 328
    • AspNetTeam

    Your configuration file looks correct to me.

    Please make sure that your request is really an Anonymous request (i.e. the Anonymous access is turned on in IIS and there are no authorization rules denying the anonymous access in the config file).

    You can also check this by displayng the User.Identity.Name in your page.

    If it's empty, then this is an anonymous request.

    When you make an anonymous request, the server should issue the anonymous cookie with name=".LINKANONYMOUS".

    This looks like this:

    Set-Cookie: .LINKANONYMOUS=lZ20mKwyxgEkAAAANjBkN2M5YWYtZTVhMC00NDgyLTliOGMtZTBjNzg2YTQxZThl235215lj8fgQFVM4oqvY8VoOwu81; expires=Thu, 16-Feb-2006 03:53:50 GMT; path=/; HttpOnly

    Also, there is a property on the Request object that you can use to retrieve the anonymous id: Request.AnonymousID.

    This is a GUID (i.e. 60d7c9af-e5a0-4482-9b8c-e0c786a41e8e) and this is the kind of users you should see in the table for anonymous requests.

    Hope this helps.

    thanks,

    laura

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-08-2005, 3:17 PM
    • Contributor
      3,349 point Contributor
    • wyx2000
    • Member since 11-25-2002, 6:43 AM
    • Posts 812

    Hi, thanks for help.

    The request is really an anonymouse request. I see LinkAnonymous in cookie, when I change the cookie name in web.config, I get new cookie, so that part works fine too.

    and I get

    User.Identity.Name :
    Request.AnonymousID :d8435a8c-a5a1-41e8-939a-2b73ab12add5

    so this works fine.

    but I can not find any anonymous entry in aspnet_users table,  no user with that GUID neither.

    Now, I am suspecting if it stores the user in the default db, I remember there was a access db for user security in beta version, in RTM, it is removed. I am just thinking hard, but I still don't have much idea about it.

  • Re: Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-08-2005, 6:33 PM
    • Participant
      1,640 point Participant
    • Laura
    • Member since 06-14-2002, 10:50 AM
    • Posts 328
    • AspNetTeam

    Are you setting the Profile property in your page?

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-08-2005, 6:41 PM
    • Contributor
      3,349 point Contributor
    • wyx2000
    • Member since 11-25-2002, 6:43 AM
    • Posts 812

    Yes, like this, it worked under beta 2

     

    <membership defaultProvider="linkProvider">

    <providers>

    <clear/>

    <add name="linkProvider" type="LinkLibrary.LinkSqlMembershipProvider" connectionStringName="dbsecurity" description="" requiresUniqueEmail="false" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordFormat="Encrypted"/>

    </providers>

    </membership>

    <profile enabled="true" defaultProvider="linkProvider">

    <providers>

    <clear/>

    <add name="linkProvider" type="LinkLibrary.LinkSqlProfileProvider" connectionStringName="dbsecurity" description=""/>

    </providers>

    <properties>

    <add name="FirstName" type="System.String"/>

    <add name="LastName" type="System.String" allowAnonymous="true"/>

    <add name="UICulture" type="System.String" allowAnonymous="true"/>

    <add name="Theme" type="System.String" allowAnonymous="true"/>

    <!--group name="Session">

    <add name="State" type="System.Object"/>

    </group-->

    </properties>

    </profile>

  • Re: Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-09-2005, 10:32 AM
    • Participant
      1,640 point Participant
    • Laura
    • Member since 06-14-2002, 10:50 AM
    • Posts 328
    • AspNetTeam

    Sorry, I meant: do you have something like this in your aspx page?

    Profile.FirstName="SomeName"

    thanks,

    laura

     

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Where does ASP.NET 2.0 insert a anonymous user? thanks

    12-09-2005, 2:05 PM
    • Contributor
      3,349 point Contributor
    • wyx2000
    • Member since 11-25-2002, 6:43 AM
    • Posts 812

    Thank you very much!

    I add that, and it works.

    It sounds right, ASP doesn't need add the visitor record unless it need store something about it.

Page 1 of 1 (7 items)