AuthManager.SetProfileTicket Method (PIA)

Use this method to set a ProfileTicketType ticket for an anonymous user. An anonymous user is not registered with a site.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Sub SetProfileTicket(UserID As String,
  fCookieSupport As Boolean)

[C#]

using Microsoft.CommerceServer.Interop;
…
void SetProfileTicket(stringUserID,
  boolfCookieSupport);

Parameters

[Visual Basic .NET]

  • UserID
    A String that contains the unique ID for the current user.
  • fCookieSupport
    A Boolean that indicates whether persistent cookies are supported.

[C#]

  • UserID
    A string that contains the unique ID for the current user.
  • fCookieSupport
    A bool that indicates whether persistent cookies are supported.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

[Visual Basic .NET]

The following table shows the custom COM errors that this method can return.

Value Description
&HC1004C23 Invalid character (';' or '%' or '=') present in the UserID or the property name/value pair.
&HC1004C24 This method should only be called within an ASP page.
&HC1004C10 The Initialize method must be called with the installed site name before calling this method.
&HC1004C40 The ticket has reached a maximum size of 4 kilobytes.

[C#]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
0xC1004C23 Invalid character (';' or '%' or '=') present in the UserID or the property name/value pair.
0xC1004C24 This method should only be called within an ASP page.
0xC1004C10 The Initialize method must be called with the installed site name before calling this method.
0xC1004C40 The ticket has reached a maximum size of 4 kilobytes.

Remarks

If a ProfileTicketType ticket for the user already exists and an empty string is passed in for the user ID, UserID, the existing ticket is deleted.

If the current user has registered, use the SetAuthTicket method to generate an AuthTicketType ticket.

[Visual Basic .NET]

Example

' oAuthManager is a Commerce AuthManager object
oAuthManager.SetProfileTicket ("74A38551-D6D8-FFD0-12BF-0A20C90DC8D1", _
 True)

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsauthlib (in mscsauthlib.dll)

See Also

AuthManager Class

AuthManager.IsAuthenticated

Copyright © 2005 Microsoft Corporation.
All rights reserved.