Compartilhar via


Factory.CreatePassportManager

Factory.CreatePassportManager

Creates an instance of a Passport Manager object from an object pool. This is useful for high-volume, multithreaded Internet applications.

Syntax

Function Factory.CreatePassportManager() As Object

Return values

The CreatePassportManager method returns a new object instance of a Passport Manager object.

Example

Create the Factory object in the application's Global.asa file.

<Object runat=server scope=application progid="Passport.Factory" id="oFactory" ></Object>

Call the method as shown.

<html>
<head><title>Using the factory</title></head>
<%
Response.Expires = -1
'Create a Passport Object
Set oMgr = oFactory.CreatePassportManager
oMgr.OnStartPageASP Request, Response
thisURL= "https://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("SCRIPT_NAME")

If oMgr.IsAuthenticated Then
    'Set the sign-out URL. Return to the main default.asp
    ruURL = thisURL & "/../../Brief/default.asp"
Else
    ruURL = thisURL
End If

TimeWindow = 3600 'one hour
Response.Write("<DIV STYLE='position:absolute;right:50px'>" & oMgr.LogoTag(ruURL,TimeWindow,False,"nothing",1033,False,"nothing",0,0) & "</DIV><br>")

If oMgr.IsAuthenticated(TimeWindow,False) Then
    Response.Write ("Welcome " & oMgr.Profile("NickName") & ". You are authenticated.")
ElseIf oMgr.HasTicket Then
    Response.Write ("Your ticket is stale.")
Else
    Response.Write ("You have not been authenticated within the past hour. Please exit.")
End If
%>
</html>

Remarks

To create a Passport Manager object, use the Factory.CreatePassportManager method. To instantiate any Passport Manager object, call the PassportManager.OnStartPageASP method on a specific Active Server Pages (ASP) page. After instantiation, all Passport Manager application programming interfaces (APIs) can be called on this instance. Do not create more than one Passport Manager instance on a single page; multiple objects can cause a system failure when they are loaded or changes to cookies are attempted.

See Also

Passport Factory Object | Manager.OnStartPageASP