Solved

Microsoft JScript runtime error 0x800A138F - trying to use Session object

Posted on 2007-03-19
6
1,682 Views
Last Modified: 2008-01-09
I am trying to use the Session object in server-side Javascript (JScript) and I get this error:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Technical Information (for support personnel)

    * Error Type:
      Microsoft JScript runtime (0x800A138F)
      Object expected
      /BofA/Scripts/Server_Functions.asp, line 31

    * Browser Type:
      Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070216 Firefox/1.5.0.10

I am getting the same error in IE6 and in Firefox 1.5.0.10. I've found nothing useful searching on the web.

Here is a snippet (error occurs on the last line):

function configQueryString() {
    var defaultConfig = "config.txt";
    Session("ConfigFile") = defaultConfig;                //     <--- error on this line

Interestingly, I can comment out this line and a few lines below that I successfully use the Application object. But I want to use the Session object.

Strangely, I have another virtual directory which also uses server side JScript in a classic ASP application and it uses Session objects successfully.

I checked in IIS via INETMGR and verified that indeed both virtual directories have "Enable Session State" checked and this is also checked for the home directory of the default web site.

This is on my desktop running Win XP Pro which in turn runs IIS 5.1. The session object should work and I cannot figure out why I am getting this crazy error. Any ideas?
0
Comment
Question by:jjamjatra
  • 4
  • 2
6 Comments
 
LVL 15

Expert Comment

by:Thogek
ID: 18752786
Some more context -- perhaps more of configQueryString code, and how configQueryString is called -- might help...
0
 

Author Comment

by:jjamjatra
ID: 18755707
Thanks for your interest in helping. Here are more snippets to give better context:

function configQueryString() {
    var defaultConfig = "config.txt";
    Session("ConfigFile") = defaultConfig;                                //  error occurs on this line
    var qs = String(    Request.QueryString("config")  );
    if (qs.length > 0) {
        if (   qs.indexOf(".txt") > -1  ) {                 // do a minimal validity check
            Application("ConfigFile") = qs;                 // set for other calling .asp files
            return qs;
        }
    }
    Application("ConfigFile") = defaultConfig;              // set for other calling .asp files
    return defaultConfig;
}
function getConfigFileName() {
    return Application("ConfigFile");
}

// create mapserver object
var mapserver;
mapserver = Server.CreateObject("Manifold.MapServer");
var selected_ConfigFile = configQueryString();
mapserver.Create(Server.MapPath(selected_ConfigFile), state, Server);

As stated earlier, note how I can access the Application object (and Request object) but my attempt to use Session object fails. Very strange. Look forward to your thoughts....
0
 
LVL 15

Accepted Solution

by:
Thogek earned 500 total points
ID: 18759888
You might want to test for the presence of Session.Contents, just to verify if the Session object itself just isn't there.  For example, just add a line referencing Session.Contents or Session.Contents.Count, or calling Session.Contents.RemoveAll(), and see if you get the same kind of error.

If so...
Verify that your Web site and/or virtual directory have "Enable session state" checked (which it sounds like you've already done).
Make sure your ASP page doesn't contain the <%@ ENABLESESSIONSTATE = False %> directive at top.  (http://msdn.microsoft.com/library/en-us/iissdk/html/8d0fb28b-2e0b-471b-97c8-c017556cf209.asp).

Hmm...
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 15

Expert Comment

by:Thogek
ID: 18760018
You could also see if this works any better:

    Session("ConfigFile") = new String(defaultConfig);
0
 

Author Comment

by:jjamjatra
ID: 18763795
Thank you for helping me past my stupid error.

I normally do VBScript and here I've inherited some server side Javascript and one of the server side INCLUDE files had a directive for ENABLESESSIONSTATE=FALSE at the top of the file. IIS was configured for enable session state (checked) but until you mentioned this I had overlooked that directive.

Many thanks.
0
 
LVL 15

Expert Comment

by:Thogek
ID: 18766741
Heh.  Don't ya both love and hate it when it turns out to be something simple like that?  :-)
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question