Поделиться через


Manager.TicketAge

Manager.TicketAge

The TicketAge property indicates the amount of time, in seconds, that has passed since a user's Ticket was issued or refreshed. The Ticket timestamp is provided either in the Microsoft .NET Passport Ticket cookie or the query string.

Syntax

Property Manager.TicketAge As Long

Property value

A Long value that gives the time, in seconds, since a silent or manual sign-in was performed.

Example

The following Microsoft Visual Basic Scripting Edition (VBScript) code snippet demonstrates the use of the HasTicket, TicketAge, and TimeSinceSignIn properties.

**Note  **The HasTicket property should be checked to be sure that a Ticket exists before using the TicketAge or TimeSinceSignIn properties. Attempting to get a property when no Ticket exists results in a run-time error.

...
Dim oMgr
Set oMgr = Server.CreateObject("Passport.Manager")

If oMgr.HasTicket Then
  Response.Write ("<br>You authenticated " & oMgr.TicketAge & " seconds ago.")
  Response.Write ("<br>You signed in " & oMgr.TimeSinceSignIn & " seconds ago.")
End if
...

Remarks

The TicketAge property is a read-only property. A Ticket contains two timestamps: the time of the last refresh (whether silent or manual), and the time of the last manual sign-in. The TicketAge property gives the difference between the last refresh (silent or manual) and the current time.

See Also

Passport Manager Object