How to Log Off in an HTML Forms Authentication Web Site (278757)



The information in this article applies to:

  • Microsoft Site Server 3.0

This article was previously published under Q278757

SUMMARY

Although Site Server offers a default method for users to log on to a Web site that is protected by HTML Forms Authentication, it is somewhat unclear how to properly log off of the Web site. For a user to properly log off from the HTML Forms Authentication portion of a Web site, you must remove the FormsAuth cookie from the client browser by using the CancelCookie method of the Membership.VerifUsr object.

MORE INFORMATION

To remove the FormsAuth cookie, add the following code to the Web page. This forces the user to log on again whenever they request a Web page that is protected by HTML Forms Authentication.

<%
Set oVUsr = Server.CreateObject ("Membership.VerifUsr.1")
oVUsr.CancelCookie "FormsAuth"
%>
				

Modification Type:MajorLast Reviewed:4/12/2001
Keywords:kbhowto KB278757