Share via


PassportIdentity.SignOut

PassportIdentity.SignOut

Signs out the Microsoft® .NET Passport user from the current session.

Syntax

public static void SignOut( string strSignOutDotGifFileName )

Parameters

  • strSignOutDotGifFileName
    An HTML fragment containing an image for the user to click to sign out.

Example

In the following C# example, the signout_good.gif file displays a green check mark, indicating a successful sign-out.

<%@ Page Language="C#"%>
<%@ Import Namespace="System.Web.Security"%>

<%
  Response.ContentType="image/gif";
  Response.Expires=1;
  
  Response.Cookies("MSPProf").Value = "";
  Response.Cookies("MSPProf").Expires = DateTime.MinValue;

  Response.Cookies("MSPAuth").Value = "";
  Response.Cookies("MSPAuth").Expires = DateTime.MinValue;

  Response.AppendHeader("P3P", "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"");
  PassportIdentity.SignOut("images/signout_good.gif");
 
%>

Remarks

The SignOut method is usually contained in the signout.aspx page.

Clicking the sign-out link redirects a user to a centrally-hosted sign-out page, which first deletes cookies in the *.passport.com domain and then uses the "visited sites" cookie (from the *.passport.com domain) to determine the identities of all sites that have been signed in to. The sign-out page loads a list of embedded "images" for each .NET Passport site that the user visited while browsing online. Each image is actually a request to an Active Server Pages (ASP) or Common Gateway Interface (CGI) file on each participating Web site. This file contains script that deletes all of the user's .NET Passport cookies in that site's domain, and then returns a consistent "check box" image that the user sees on the sign-out page. In order for the user to see the check mark for your site's sign-out procedure, your site's ASP/CGI cookie-delete page must actually return an image as its response output.

See Also

Passport PassportIdentity Object | Implementing Sign-Out and Deleting Cookies