UserID of Anonymous user

  • Thread starter Thread starter matt.sickler
  • Start date Start date
M

matt.sickler

Does anyone know how to get the UserID of the Anonymous user?

The following only returns the UserName, not the UserID

HttpContext.Current.Profile.UserName
and
HttpContext.Current.Request.AnonymousID

also, this does not work for anonymous users

MembershipUser mu =
Membership.GetUser(HttpContext.Current.Profile.UserName);
return (Guid)mu.ProviderUserKey
 
the AnonymousID just a unique number stored in a cookie (if cookies are
enabled), which can be used for tracking or saving profile info for an
anonymous login.

if the login is anonymous, then there is no username as the browser was not
required to send any, thus the term anonymous.

-- bruce (sqlwork.com)
 
Back
Top