?
Solved

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

Posted on 2007-03-19
6
Medium Priority
?
1,696 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 2000 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

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
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

743 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