Solved

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

Posted on 2007-03-19
6
1,687 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 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