Solved

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

Posted on 2007-03-19
6
1,680 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now