Solved

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

Posted on 2007-03-19
6
1,677 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
Comment Utility
Some more context -- perhaps more of configQueryString code, and how configQueryString is called -- might help...
0
 

Author Comment

by:jjamjatra
Comment Utility
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
Comment Utility
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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 15

Expert Comment

by:Thogek
Comment Utility
You could also see if this works any better:

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

Author Comment

by:jjamjatra
Comment Utility
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
Comment Utility
Heh.  Don't ya both love and hate it when it turns out to be something simple like that?  :-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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