Microsoft KB Archive/263964

= How To Programmatically Switch Between Anonymous Cookie and Forms Authentication =

Article ID: 263964

Article Last Modified on 7/2/2004

-

APPLIES TO


 * Microsoft Site Server 3.0 Standard Edition
 * Microsoft Site Server 3.0 Commerce Edition

-



This article was previously published under Q263964



SUMMARY
A common issue that many Site Server administrators face is how to switch between Anonymous Cookie Authentication and Forms Authentication.



MORE INFORMATION
A Web site may allow access to both anonymous and registered users, and provide ways for the anonymous users to configure and save their preferences. When the anonymous user becomes a registered user, the Web administrator needs to transfer the preferences in the anonymous user profile to the registered user profile.

The code below demonstrates how you can programmatically migrate the anonymous user profile to the members container. Sub MoveMember(byval strUserID) Dim oParent Dim oContainer Dim oCookie Dim oAUO Dim sGIUD

On Error Resume Next sGUID = Request.Cookies(&quot;SITESERVER&quot;)(&quot;GUID&quot;) ' Check if cookie has GUID. if sGUID <> &quot;&quot; Then '       ' Get the parent object. Set oParent = oAUO.GetObjectAsUser(objAUO.Parent) '       ' Get the grandparent object. Set oContainer = oAUO.GetObjectAsUser(oParent.Parent) '       'Move the object to the target container. oContainer.MoveHere oAUO.ADsPath, &quot;cn=&quot; & strUserID

' Create the cookie object. Set oCookie = Server.CreateObject(&quot;Membership.verifusr.1&quot;) ' Issue cookie to the old user. oCookie.IssueCookieToOldUser(cstr(strUserID)) End if End Sub

Additional query words: ss3 ldap movehere

Keywords: kbhowto KB263964

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.