Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

global.asa ignored

Posted on 2013-01-14
13
Medium Priority
?
403 Views
Last Modified: 2013-01-18
Hi Experts,

I have the following code:

global.asa
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart

	
	Session.Timeout = 10
	Session("getRates") = True
	

End Sub
</script>

Open in new window


includes/common.asp
Session("getRates") = False

Open in new window


test.asp
<%@ Language=VBScript %>

<%Session("Root") = "../"%>

Before common.asp getRates = <%=Session("getRates")%> <br>

<!--  <!-- #include file = "../includes/common.asp" -->

After common.asp getRates = <%=Session("getRates")%> <br> <br>

<%=Now()%>

Open in new window


The result I get is
Before common.asp getRates =
After common.asp getRates = False

14/01/2013 1:26:26 PM

Why is my first line empty?  

When I run this, I expect it to be True, False.
After, when i refresh before 10min, I expect False, False.
After, when i refresh after 10min, I expect True, False. Here I still False, False.

How come my initialization from global.asa isn't recognized?

I already restarted IIS.

Thank You
0
Comment
Question by:APD_Toronto
[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
  • 8
  • 5
13 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38776006
I think global.asa must be in the root of your website.

(EDIT) PS: you didn't state anything about that but judging from the statement
Session("Root") = "../"

Open in new window

I gathered these files are all located within a subdirectory or virtual directory.
0
 

Author Comment

by:APD_Toronto
ID: 38778818
My global.asa is in deed in my root.

This, however is on my localhost, where i access this as
http://localhost/website/cart/test.asp

global is under
C:\inetpub\wwwroot\website\global.asa

Do I need to change somethhing in IIS to make "website" independent?  Maybe /website isnt't the root?
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38778857
Ok, so the global.asa is under /website and test.asp is under /website/cart?

Unless there are other websites running under the same root it should be easy to try moving it 1 level up (C:\inetpub\wwwroot\global.asa).

The eventual solution depends on the version of IIS, I think starting with version 7 there is an "Application" type folder which means the global.asa can stay in the /website folder if you convert the (virtual) directory to an Application folder. Under that the ".." is no longer available, that would essentially be like trying to access a different website.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:APD_Toronto
ID: 38778914
under IIS7, i have "convert to application", but not not "convert to web"

I know I hacve converted to web before, as i see sites listed under my iis, but can't remember how i did.
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38778930
under IIS7, i have "convert to application"
But that's the one I meant, that should make /website your root and so it should recognise your global.asa
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38778940
If you had wanted to make a new website then you should right click a level higher, also this is only available I think in Win Professional, not Home versions.

EDIT: but only available is 'New website', not 'convert' AFAIK...
0
 

Author Comment

by:APD_Toronto
ID: 38779001
ok, i converted website as a site under port 8082, but now:

if i go to http://localhost/website/cart/test.asp, my- first result is <empty>, False - back to my original post.

if i go to http://localhost:8082/cart/test.asp - i get
HTTP/1.1 New Application Failed

What am i doing wrong, and am i using the propper URL?
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38779032
Hmm, I just tested the "convert to application" and works like a charm: True/False like you expected...

The first part of your last post probably still refers to the same existing files so nothing changed there.

The second part seems correct to me but hard to really say much about it without knowing the whole configuration. The place to start if you wanna go down this route (as opposed to the 'convert') would be the IIS logging.
0
 

Author Comment

by:APD_Toronto
ID: 38779079
IIS Logging?  How and what would that show?

Could you maybe walk me through how to create a new site and test out my code above?
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38779116
IIS logging can be found under c:\inetpub and/or c:\windows\system32\logfiles, it sometimes shows the real reason behind an otherwise inexplicable error.

From IIS, you probably right clicked on Sites and chose Add Web Site. Then because you need to have some distinction you chose to run it on port 8082? Then set the path to the same path as before and that should normally work. However googling for that error there seem to be lots of possible reasons for it.

I get the feeling the 'convert' would be a lot easier. (and also looking at the clock a better solution to try)
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38779184
I'm gonna be out for a couple of hours so hope to talk to you later or tomorrow.
0
 

Author Comment

by:APD_Toronto
ID: 38779186
Any ideas:

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2013-01-15 16:26:45
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2013-01-15 16:26:45 ::1 GET /cart/test.asp |-|ASP_0145|New_Application_Failed 8082 - ::1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MDDR;+IPH+1.1.21.4019) 500 0 0 0

Open in new window

0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 38780884
Before I go into that log please explain why you haven't reacted to about 4 remarks now concerning the 'convert to application' which should work swimmingly...
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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