Solved

Global.asa

Posted on 2002-05-28
6
319 Views
Last Modified: 2013-12-24
It's gotta be a dumb question -

How do I create the global.asa file?

What are the required values?

Any good reading on global.asa?
0
Comment
Question by:goldstar
6 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 7039539
You don't need to create one. The only use is if you're custom coding ASP pages and know EXACTLY what you're doing. I've got lots of ASP pages, database connections, includes, forms, etc. and I don't have one. Everything works just fine without it.

Sometimes FP will create one if it needs it. If it doesn't make one, you don't need it. ;-)
0
 
LVL 10

Expert Comment

by:KenAdney
ID: 7040507
webwoman is, as alway, correct.  There's some more info about the content/purpose of the file at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/glob63vp.asp
0
 

Author Comment

by:goldstar
ID: 7041719
I have a series of pages (all within a virtual directory) that can be accessed only with a userid & password.  

My intent is to store a variable after the user has successfully logged in from the login page.  

I want to check for this variable on all pages witin the virtual directory to prevent access from a bookkmarked page.

Is the global.asa needed for this?

If not, could you give an example of what the "check for status of variable would like?  I've been trying this on the pages:

if session("logged_in") <> "Y" then
     response.redirect "//http:999.9.9.99/login.asp"
end if

and this is on the authentication page:
<%
dim x
x = Request.ServerVariables("HTTP_REFERER")
if x = "http://999.9.9.999/authenticated.asp" then
     session("logged_in") = "Yes"
     'response.write "Session: " + session("logged_in")
else
     session("logged_in") = "No"
     response.redirect "http://158.6.1.76/login.asp"
end if
%>

But the variable does not get passed.  That is why is thought about the asa file.

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 19

Expert Comment

by:webwoman
ID: 7043260
Set a cookie... but you have to do it BEFORE you write any HTML content.

You're checking the wrong thing. If you want to check the referring document URL, you can use javascript -- document.referrer does exactly that. If you want to set something for the client, a cookie is easier. You can do a session variable as well, which is basically a cookie stored on the server.

You do that on the first page. On the first and the other pages, you check to see if the cookie exists, and if the login value is 'logged in' (for example). If it does, they're logged in. If it doesn't, they're not. You can then redirect from there.

I'd have to look up the proper syntax, but any good ASP tutorial site should have it. Check www.asp101.com -- they usually have good tutorials.
0
 
LVL 1

Accepted Solution

by:
choroque earned 50 total points
ID: 7048357
The global.asa file is automatically created if you create a new project using Visual Interdev.
0
 

Author Comment

by:goldstar
ID: 7050906
Thanks for the answer to my question.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

832 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