• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

XMLHTTP syntax in global.asa

I am trying to make my application do a XMLHTTP post whenever a new session starts.
My code is basically the following:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("SessionCount") = 0
End Sub

Sub Session_OnStart

Application.Lock
Application("SessionCount") = Application("SessionCount") + 1
Application.Unlock

Application("xmlhttp") = server.CreateObject("Microsoft.XMLHTTP")
...etc

End Sub
 
</SCRIPT>

The above does not work. What went wrong? Thanks in advance
0
wallgecko
Asked:
wallgecko
1 Solution
 
anderson22Commented:
You can't assign objects directly to a session variable.  Use your object like normal and then assign it to the application variable.  When you want to use it in the future, assign a regular variable the value of the application object.

Ex:
'to store the object into the application variable
Set xmlhttp= server.CreateObject("Microsoft.XMLHTTP")
Set Application("xmlhttp") = xmlhttp

'to retrieve the object from the application variable
Set xmlhttp = Session("xmlhttp")

-rca
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now