UsrID Function:

The UsrID function returns the sessionID of a site visitor. The sessionID is a unique number generated by the server for each site visitor and remembered for the duration of a session. Using this function is exactly the same as typing Session.SessionID with one bonus: If the session is disabled through an @ directive, or if an error is encountered during the gathering of the sessionID, the UsrID function returns Null.

long = UsrID
Example Usage:
<% @   Language = VBScript   EnableSessionState = False  %>
Dim a

a = UsrID
If IsNull(a) Then
	 ' session disabled or unavailable due to error...
	response.write	"SessionID not available at this time. " & _
				"You will not be able to save " & _
				"items into your shopping cart " & _
				"at this time."
End If
ASP Source Code:
Private Function UsrID()
	On Error Resume Next
	UsrID = Session.SessionID
	If IsNumeric(UsrID) Then UsrID = CLng(UsrID)
	If Err Then UsrID = Null
	On Error GoTo 0
End Function