<%@Language=VBScript %> <% Option Explicit '******************************************* '* File: connect_time.asp '* Author: Nick Heap '* Date: Jun 15 2004 '* Version: 1.0 '* Description: display the length of time the user has been connected this session '* '******************************************* Dim timCurrentTime, timDisplayTimeHrs, timDisplayTimeMins, timDisplayTimeSecs Dim lngTimeDiff Dim intConnectPageVisits, intAbandonPageVisits 'increment visitor count to this page Application.Lock Application("VisitsConnectPage") = Application("VisitsConnectPage") + 1 intConnectPageVisits = Application("VisitsConnectPage") intAbandonPageVisits = Application("VisitsAbandonPage") Application.Unlock 'get the current system time timCurrentTime = Time 'calculate the minutes difference using DateDiff timDisplayTimeHrs = DateDiff("h",Session.Contents("timStartTime"),timCurrentTime) timDisplayTimeMins = DateDiff("n",Session.Contents("timStartTime"),timCurrentTime) timDisplayTimeSecs = DateDiff("s",Session.Contents("timStartTime"),timCurrentTime) %> Connect Time Total number of visitors to this site: <%= Application("NumberOfVisitors") %>
Total number of visitors to 'connect_time.asp': <%= intConnectPageVisits %>
Total number of visitors to 'abandon_session.asp': <%= intAbandonPageVisits %>

The time is: <%= timCurrentTime %>
You connected at: <%= Session.Contents("timStartTime") %>
You have been connected for: <%= timDisplayTimeHrs %> hours
You have been connected for: <%= timDisplayTimeMins %> minutes
You have been connected for: <%= timDisplayTimeSecs %> seconds

This is some text to display.
Refresh
Create & Display Session Cookie
Log-off