Get anonymous user

Discussion in 'ASP .Net' started by shapper, Nov 14, 2008.

  1. shapper

    shapper Guest

    Hello,

    I am trying to get an anonymous user using the following:

    MembershipUser user = System.Web.Security.Membership.GetUser();

    However, user is null. On my Web.Config I have the following:

    <anonymousIdentification
    cookieless="UseCookies"
    cookieName=".AnonymousIdentification"
    cookiePath="/"
    cookieProtection="Validation"
    cookieRequireSSL="false"
    cookieSlidingExpiration="true"
    cookieTimeout="100000"
    enabled="true"/>

    I cleaned all my browser cookies and ran the web site but I always get
    user = null.

    What am I doing wrong?

    Thanks,

    Miguel
     
    shapper, Nov 14, 2008
    #1
    1. Advertising

  2. shapper

    shapper Guest

    On Nov 14, 6:11 pm, "Patrice" <http://www.chez.com/scribe/> wrote:
    > The overall goal is ? You are confusing MemberShip and Profile ?
    >
    > I'm not sure what you expect to get for an anonymous user (i.e. by design
    > the user is not known so ???). The profile feature on the other hand have
    > the ability to migrate an anonymous profile to an authenticated user (if
    > this is what you are looking for)
    >
    > --
    > Patrice
    >
    > "shapper" <> a écrit dans le message de groupe de
    > discussion :
    > ...
    >
    > > Hello,

    >
    > > I am trying to get an anonymous user using the following:

    >
    > > MembershipUser user = System.Web.Security.Membership.GetUser();

    >
    > > However, user is null. On my Web.Config I have the following:

    >
    > >    <anonymousIdentification
    > >      cookieless="UseCookies"
    > >      cookieName=".AnonymousIdentification"
    > >      cookiePath="/"
    > >      cookieProtection="Validation"
    > >      cookieRequireSSL="false"
    > >      cookieSlidingExpiration="true"
    > >      cookieTimeout="100000"
    > >      enabled="true"/>

    >
    > > I cleaned all my browser cookies and ran the web site but I always get
    > > user = null.

    >
    > > What am I doing wrong?

    >
    > > Thanks,

    >
    > > Miguel


    I understand that an anonymous user is set my a cookie.
    But when using a custom profile provider that inherits ProfileBase how
    can I get the anonymous properties of the anonymous user?

    I tried always get an error ... that is why I was thinking I might
    need to somehow get the anonymous user first or something like this.

    Thanks,
    Miguel
     
    shapper, Nov 14, 2008
    #2
    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. Curt_C [MVP]
    Replies:
    2
    Views:
    358
    Curt_C [MVP]
    Sep 21, 2004
  2. =?Utf-8?B?U2hhcmlm?=

    use anonymous but get get an authentication box

    =?Utf-8?B?U2hhcmlm?=, Sep 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    369
    =?Utf-8?B?U2hhcmlm?=
    Sep 21, 2004
  3. Jeff
    Replies:
    2
    Views:
    593
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 10, 2006
  4. Reporter
    Replies:
    3
    Views:
    477
    Mike Schilling
    May 12, 2007
  5. Replies:
    1
    Views:
    223
Loading...

Share This Page