Testing the Session Object
View the source code

Number of Session variables = 13

All Session variables
List of 13 items in Session contents collection:
  • NULL = [NULL]
  • EMPTY = [EMPTY]
  • integer = 123 [INTEGER(2)]
  • largeInteger = 12356789 [INTEGER(4)]
  • float = 1.2 [FLOAT(8)]
  • largeFloat = 123567.89 [FLOAT(8)]
  • currency = 12.34 [CURRENCY]
  • date = 11/22/2017 9:53:18 AM [DATE]
  • someString = hello world [STRING]
  • dbObject = Provider=MSDASQL.1; ...[OBJECT]
  • BOOL = True [BOOL]
  • anArray = [ARRAY]
  • first [STRING]
  • 543.21 [FLOAT(8)]
  • third [STRING]
  • aStringVariable = aStringVariableValue [STRING]
  • All Session variables by index
    List of 13 items in Session contents collection (by index):
    1 : [NULL]
    2 : [EMPTY]
    3 : 123 [INTEGER(2)]
    4 : 12356789 [INTEGER(4)]
    5 : 1.2 [FLOAT(8)]
    6 : 123567.89 [FLOAT(8)]
    7 : 12.34 [CURRENCY]
    8 : 11/22/2017 9:53:18 AM [DATE]
    9 : hello world [STRING]
    10 : Provider=MSDASQL.1; ...[OBJECT]
    11 : True [BOOL]
    12 : [ARRAY]
  • first [STRING]
  • 543.21 [FLOAT(8)]
  • third [STRING]

  • 13 : aStringVariableValue [STRING]

    Non-existant variable
    (This generates no errors)
    Session( fred) =

    Non-existant index
    (This generates no errors)
    Session( 437) =

    Try to set a NULL Session variable name
    Session( NULL) = "null variable"
    ERROR : Type mismatch (Microsoft VBScript runtime error)

    Try to set an Built-In Object
    Set Session( "intrinsicVar") = Response
    ERROR : 006~ASP 0168~Disallowed object use~An intrinsic object cannot be stored within the Session object. (Session object)

    Try to get an Built-In Object's default property
    Session( "intrinsicVar") = Response
    ERROR : 006~ASP 0185~Missing Default Property~A default property was not found for the object. (Session object)

    Display the LCID and CodePage values
    LCID = 1033
    CodePage = 1252

    Test passing these Session variables to another ASP page
    (and test removing elements)