Private Function createForumSessionID()
Dim dblNowDate
Dim strClientIP
Dim objTypeLib
Dim strTypeLibGUID
'Set error trapping in case the system doesn't support Scriptlet.TypeLib
On Error Resume Next
'Generate unique session ID
Set objTypeLib = CreateObject("Scriptlet.TypeLib")
strTypeLibGUID = LCase(Mid(CStr(objTypeLib.Guid), 2, 36))
Set objTypeLib = Nothing
'Disable error trapping
On Error goto 0
'If we have got a GUID from the system use that for the session ID
If NOT strTypeLibGUID = "" Then
createForumSessionID = strTypeLibGUID
'Else we need to create a session ID
Else
'Get the time as a double number
dblNowDate = CDbl(Now())
dblNowDate = Mid(dblNowDate, InStr(1, dblNowDate, ".")+1, Len(dblNowDate))
'Application session number to ensure that the sessions ID is unquie
Application("SessionNum") = Application("SessionNum") + 1
'Calculate a code for the user
createForumSessionID = Application("SessionNum") & "-" & LCase(hexValue(20)) & dblNowDate
End If
End Function